SoFunction
Updated on 2025-04-14

batchcollect pagecollect from the official Jieqi timed collection configuration method and parameters detailed explanation of


The method of creating a batch file is as follows:
Create a file with the suffix name .bat in any directory, such as D:\, and then enter a code similar to the following using a text editor


@echo off
"explorer" "https:///modules/article/admin/?action=collect&siteid=1&collectname=0&startpageid=1&maxpagenum=1&notaddnew=0&jieqi_username=admin&jieqi_userpassword=1234"
"explorer" "https:///modules/article/admin/?action=bcollect&siteid=1&batchids=123,234,345&jieqi_username=admin&jieqi_userpassword=1234"
exit


in
The first sentence @echo off means to turn off the display
The last sentence exit means exit after execution
Each line in the middle represents a collection command (multiple lines can be set), which is to use the system's browser to execute the previously edited collection url.
Use this format:

"explorer" "url"

The first part is the command and the subsequent collection of urls can also be used in this format:

"%programfiles%\Internet Explorer\" "url"

The first part is the path to the IE browser, and the next part is the collected URL.

The difference between these two command modes is that when there are multiple lines of command, the former will open multiple browser windows to execute simultaneously; while the latter will open the browser first to execute the first command, and you must wait until the browser is closed before reopening a browser to execute the second command.

After editing the above bat file, start adding and executing this task in the task plan. The main steps are as follows (acquisition is performed every half hour):

a. Open the "Control Panel" and enter "Task Plan".
b. Click "Add Task Schedule" to open the Task Schedule Wizard to add tasks.
c. Click "Next", and then click "Browse" to select the program to be executed. (In the example, choose D:\)
d. Set the task name and execution frequency, such as selecting "Daily" and click "Next".
e. Select the initial execution time and date. Generally, just set it a little later than the current time, click "Next".
f. Set the execution user name and password (the account number of this operating system), and click "Next".
g. Select "When click "Finish", open the advanced properties of this task" and click "Finish".
h. In "Schedule", click "Advanced", select "Repeat Tasks", and set "Every 30 minutes".
i. After saving the above settings, complete the system task plan.


2. How to do it in the Linux environment

System timing tasks that can be used in Linux are also required to first create a batch script. The method is as follows
Create a file with the suffix .sh in any directory, such as /www/, and requires assignment of executable permissions, such as chmod 755/www/
The contents are as follows:


wget -qO - "https:///modules/article/admin/?action=collect&siteid=1&collectname=0&startpageid=1&maxpagenum=1&notaddnew=0&jieqi_username=admin&jieqi_userpassword=1234"
wget -qO - "https:///modules/article/admin/?action=bcollect&siteid=1&batchids=123,234,345&jieqi_username=admin&jieqi_userpassword=1234"

 

Each line represents a collection command (multiple lines can be set), which uses the system's wget command to call the url to execute and cancel the output.
Each line of command is as follows:
wget -qO - url
The previous "wget -qO -" is the wget command and parameters, and the subsequent url is the edited collection url

After editing the sh file, use the crontab command to add the timing tasks. The main steps are as follows:

a. Use the crontab -e command to open the timing task editor, and a line inside represents a timing task.
b. Use the vi command to add a line of commands to execute batch scripts regularly, the format is as follows:
f1 f2 f3 f4 f5 program 
where f1 represents minutes, f2 represents hour, f3 represents what day of a month, f4 represents month, and f5 represents what day of a week. program represents the program to be executed.
When f1 is *, it means that the program must be executed every minute, when f2 is *, it means that the program must be executed every hour, and so on.
When f1 is a-b, it means that it must be executed from a minute a to b to minute b, when f2 is a-b, it means that it must be executed from a to b to hour, and so on.
When f1 is */n, it means that it is executed once every n minutes interval, f2 is */n, it means that it is executed once every n hours interval, and so on.
When f1 is a, b, c,..., it means that the minute must be executed, f2 is a, b, c,... when f2 is a, b, c,... it means that the hour must be executed, and so on.
program is the command or program file name to be executed

Example 1: Acquisition is performed every 30 minutes
*/30 * * * * /www/

Example 2: Perform acquisition at the 10th minute of each hour
10 * * * * /www/

c. For detailed usage of the crontab command, please refer to the relevant documents, which can be searched online.

Note: Windows task planning and Linux timing tasks can be set up multiple times, but it is necessary to avoid opening multiple browsers at the same time to collect them at the same time, so that errors will occur when judging the latest chapters.