SoFunction
Updated on 2025-04-09

batchcollect pagecollect from the official Jieqi timed collection configuration method and parameter detailed explanation page 1/2

Preface

To implement collection, the default method is to submit the corresponding parameters in the browser to complete all subsequent collection and storage actions according to the configured collection rules.
Realizing timed collection is somewhat different from manual submission in the browser, and it is mainly divided into two major steps:
1. Write the collected url and related parameters, and access this url to achieve the desired acquisition mode. (This url can also be collected by submitting it directly in the browser)
2. Add the function of timed access to this url to the system's timing tasks to realize unattended timing collection.

For specific implementation methods, please refer to the following content:

1. Interpretation of the acquisition of configuration files

Any collection will use two collection configuration files (corresponding to the background collection rule configuration), and can be opened and viewed using a text editor.
Among them, /configs/article/ is the configuration of the total collection site, and records which sites are allowed to be collected.
It contains content like this:

$jieqiCollectsite['1']['name'] = 'Collection site one';
$jieqiCollectsite['1']['config'] = 'abc_com'; 
$jieqiCollectsite['1']['url'] = ''; 
$jieqiCollectsite['1']['subarticleid'] = 'floor($articleid/1000)';
$jieqiCollectsite['1']['enable'] = '1';

$jieqiCollectsite['2']['name'] = 'Collection site two';
$jieqiCollectsite['2']['config'] = 'def_net';
$jieqiCollectsite['2']['url'] = '';
$jieqiCollectsite['2']['subarticleid'] = '';
$jieqiCollectsite['2']['enable'] = '1';

The meaning of the parameters is explained as follows:
['1'] -                                                           �
['name'] - Collection of website name.
['config'] - The website English logo is related to the website collection rule configuration file. For example, the value is abc_com, then the collection rule configuration file is /configs/article/site_abc_com.php.
['url'] - Collection website URL.
['subarticleid'] -   Collection website, article sub-number calculation method. This project is mainly to be compatible with previous programs. The article sub-number in the new version can be obtained through collection.
['enable'] - Whether to allow collection, 1 means allow, 0 means prohibited, default is 1.

As mentioned earlier, each collection website has a special collection rule configuration file, and a php file starting with site_ in the /configs/article/ directory, such as /configs/article/site_abc_com.php.

The contents in it correspond to the background collection rules settings, and the specific details will not be explained one by one. It should be understood that the content in this file is divided into two parts. The first content is the configuration of the website content collection rules. At the end, $jieqiCollect['listcollect']['0'] and $jieqiCollect['listcollect']['1'] are the configuration of the website's "batch collection rules". For example, collecting according to the latest updates and collecting according to the ranking list, you can set multiple settings. ['0'] The number here 0 represents the number serial number of the batch collection category, and the same website cannot be repeated.

2. Write the URL and parameters of the collected content

The collection here is for batch collection of multiple articles, divided into two modes:
1. Collect batches by page, such as collecting the latest update list or ranking list, and collecting one page for each link.
The link format is as follows:

https:///modules/article/admin/?action=collect&siteid=1&collectname=0&startpageid=1&maxpagenum=1&notaddnew=0&jieqi_username=admin&jieqi_userpassword=1234

The meaning of the parameters is explained as follows:
- Refers to your website.
action -  String, action command executed by the program, fixed value is collect.
siteid - number type, the website number to be collected. See the configuration file for specific websites that correspond to which serial number.
collectname - number type, the category number collected in batches by the page, see the configuration file site_xxxx.php below. $jieqiCollect['listcollect']['0'] The number configured in this way.
startpageid -  Page number flag, indicating which page to collect it starts from. Generally, it is a numeric type, and some websites may also be strings.
maxpagenum - Number type, indicating how many pages were collected in total. (The default is 1. If you want to collect multiple pages, the browser needs to jump. It is only valid when calling the browser in the Windows environment. When calling wget under Linux, you can only collect one page at most. If you need to collect multiple pages, you can set multiple collection commands.)
notaddnew -- numeric type, 0- means collecting all articles, 1- means only updates of existing articles on this site.
jieqi_username - Standard, user name (this user must be a user with permission to collect on this site).
jieqi_userpassword - String, user password.


2. Batch collection according to the article serial number
The link format is as follows:
https:///modules/article/admin/?action=bcollect&siteid=1&batchids=123,234,345&jieqi_username=admin&jieqi_userpassword=1234

The meaning of the parameters is explained as follows:
- Refers to your website.
action -  String, action command executed by the program, fixed value is bcollect.
siteid - number type, the website number to be collected. See the configuration file for specific websites that correspond to which serial number.
batchids - The article number of the other party's website to be collected (not the local article number). Collect multiple articles, and the serial numbers are separated by English commas, such as 123,234,345.
jieqi_username - Standard, user name (this user must be a user with permission to collect on this site).
jieqi_userpassword - String, user password.

Note: When a url needs to be submitted in the IE browser, the maximum length of the entire url should not exceed 2083 bytes, so it is generally recommended that the url here should not be set to be too long. If there are many articles, you can split it into multiple urls.


3. Use system tasks to achieve timed acquisition

1. How to do it in the Windows environment

In Windows, the system's task plan can be used to implement the timed execution of the program, but first, you need to create a batch file, and use commands to call the browser to execute the collection URL. It should be noted that the command can only be opened to the browser and will not be automatically closed after collection. To achieve automatic closing after collection, it can be implemented through JavaScript. The js code that automatically closes this window is:

<script language="javascript"> =null; setTimeout("();", 3000); </script>

The parameter here 3000 refers to the delayed shutdown time, the unit is milliseconds, and 3000 refers to the delayed shutdown of 3 seconds.
This code can be added in two places:

One is to add the prompt message template /themes/style name/, and add the above js between <body> and </body>. This effect is that any prompt information page of the entire system will be automatically closed after 3 seconds.

If you want to automatically close the prompt page after the collection is successful, you can add the above javascript to the language package where the collection prompt information is collected. This configuration file is /modules/article/lang/lang_collect.php. In  $jieqiLang['article']['batch_collect_success'], the prompt information for the collection is successful. This value was originally:

'Congratulations, all articles have been collected! ';

Change it to the following so that it will automatically close

'Congratulations, all articles have been collected! <script language="javascript"> =null; setTimeout("();", 3000); </script>';
12Next pageRead the full text