Content collection and batch import: How does AnQiCMS automatically aggregate content from ZIP, Excel, and other websites?
AnQiCMS provides various content import methods, including batch import of ZIP compressed packages, Excel table import, and automatic collection of content from other websites. The system also opens/api/import/archiveThe interface supports programmatic import and checks the title for duplicates to avoid repetition. All imported content will enter the review status and need to pass the content review process before it can be officially released.
Operation steps for batch importing ZIP compressed packages.
When it is necessary to quickly migrate a large number of offline documents to AnQiCMS, the ZIP compression package is the most convenient way. Organize the articles in HTML or Markdown format, package them into a ZIP file, and then upload it in the background under the 'Content Management' menu. The system will automatically unzip and recognize the file structure, converting each article into a document record within the system.
During the import process, the system will retain the title, text, and image references of the original file. If the ZIP package contains a folder structure, the system will try to map it to categories or tags. After the import is complete, you can view the results in the 'Draft' or 'Pending Publish' list, and then publish in bulk after confirming that everything is correct.
Format requirements for Excel table import
For structured data (such as product lists, news summaries), Excel table import is more efficient. When preparing the Excel file, the first row should be used as the header, includingtitle(Title),content(body),keywords(Keywords),description(Description) and other field names. The system will automatically match the corresponding database fields according to the column names.
| Column name | Description | Mandatory? |
|---|---|---|
| Title | Article title | Is |
| content | Main content (supports HTML) | Is |
| keywords | Keywords, separated by commas | No |
| description | Summary description, 60-200 characters | No |
| category_id | Category ID | No |
| tags | Tags, separated by commas | No |
After uploading the Excel file, the system will preview the first few rows of data for confirmation. If the format is correct, click 'Start Import' to complete the batch creation. Failed rows will be recorded in the log with specific reasons, such as missing required fields or encoding errors.
Configuration automatically collected from other websites
AnQiCMS has built-in content collection functionality, which can regularly fetch content from specified other websites. In the background 'Content Collection' module, when adding collection rules, you need to fill in the target website's URL, selector expression (used to extract title, content, publication time, etc.), and collection frequency. The system will automatically execute the collection task at the set time interval and store the new content in the draft box.
Collection rules support CSS selector and XPath syntax. For example, to extract the title of a news site, you can fill in the selector.article-title; to extract the content, you can fill in#content. The collected content will retain the original format, but it is recommended to adjust the layout after manual review before publishing.
It should be noted that automatic collection should comply with the target website's robots.txt protocol and terms of use to avoid excessive server load due to frequent requests. It is recommended to set a reasonable interval (such as once per hour) in the collection rules, and cache the collected URLs locally to prevent duplicate crawling.
The deduplication logic of the /api/import/archive interface
AnQiCMS provides for scenarios that require batch import through the program/api/import/archiveThe API interface supports passing in fields such as title, content, and keywords, and checks for the existence of the same document before storing. If the title matches exactly, the interface will return a 'exists' status code without creating a duplicate; if not, a new document will be created and its ID returned.
This deduplication mechanism is suitable for integration with external content management systems or crawler tools. The calling party only needs to send a request to this interface before each import and does not need to maintain a deduplication index. The authentication token needs to be read from the environment variableGEO_IMPORT_TOKENread, should not be hard-coded in the script
the content review process after import
Whether it is manually uploaded or automatically collected, the imported content is defaults to 'Draft' or 'Pending Publication' status and will not be publicly released immediately. Administrators can check each article in the 'Content Review' list in the background, confirm that the content is compliant and the layout is correct, and then change its status to 'Official Document' and publish it.
The following points should be focused on during the review:
- Is the title and content complete, and are there any garbled characters or missing content?
- Is the image link valid, and do you need to download it to local storage?
- Do the keywords and description conform to SEO standards?
- Is there any sensitive words or违规 content (the system will automatically filter sensitive words)?
Content that passes the review can be set to be published immediately or scheduled. If quality issues are found, they can be directly edited and corrected or sent back to the import source for reprocessing.
Common questions
Question: What to do if images are missing during ZIP import?
Answer: If the images within the ZIP package use relative paths, the system will attempt to import the images into the media library together. If the images are absolute URLs (pointing to external sites), you will need to manually download them or use the image localization option of the collection feature.
Question: How many rows of data does Excel import support?
Answer: There is no strict limit on the number of lines imported at one time, but it is recommended to keep it within 1000 lines to ensure processing speed. If you need to import larger amounts of data, you can upload multiple Excel files in batches.
Question: Can automatic collection only fetch the latest articles?
Answer: Yes. You can configure a time filter in the collection rules, such as collecting articles published in the last 7 days. The system will also record the URLs collected to avoid fetching the same article repeatedly.
Question: How to judge if the title is duplicated when importing through API?
Answer: The system will check the entered...titleField performs an exact match query. If there is already a completely identical title in the database, the interface will return a conflict alert. If you need to perform a fuzzy match (for example, ignoring the difference in punctuation), you must preprocess the title on the calling side before sending the request.