Applicable scenarios
- The user says "help me search for official account articles/recent articles with a certain keyword"
- Need to quickly obtain: title, summary, publication time, official account name, accessible link
Workflow
Step 1: Confirm that dependency packages are installed
This script depends on the NodeJS dependency package cheerio, enter the skill directory to install:
cd skills/wechat-article-search && npm install
Step 2: Confirm the number of search terms
1. Confirm keywords and quantity
Step 3: Execute the search command
1. Execute the search command (by default it will automatically try to resolve the real WeChat article link)
node scripts/search_wechat.js "关键词"
Special workflow (optional)
- Execute the search command including a quantity limit
node scripts/search_wechat.js "关键词" -n 15
- If the user needs to save the results to a file, execute the command
node scripts/search_wechat.js "关键词" -n 20 -o result.json
- If the user needs JSON format output, execute the command
node scripts/search_wechat.js "关键词" json
Parameter description
query: Search keyword (required)-n, --num: Number of results to return (default 10, maximum 50)-o, --output: Output JSON file path (optional)-r, --resolve-url: Resolve the real WeChat article URL (enabled by default)--no-resolve-url: Skip real link resolution and directly return the Sogou redirect linkjson, --json: Directly output JSON format data, convenient for program processing
Output format
Formatted output (default)
Output search results in an easy-to-read text format; each article contains the following information:
序号. 文章标题
📌 来源: 公众号名称 | ⏰ 时间信息
💡 文章内容概要
🔗 [查看详情](<完整链接>)
Time information format:
- If there is a complete timestamp:
HH:MM (相对时间描述), for example:23:45 (1小时前) - If there is only relative time: display directly, for example:
2小时前
Output characteristics:
- There is a blank line separating each article
- Source and time are displayed on the same line
- Links display the complete URL address, using the
[查看详情](<链接>)format
JSON output (using the json parameter)
{
"query": "搜索关键词",
"total": 10,
"articles": [
{
"title": "文章标题",
"source": "公众号名称",
"datetime": "2026-03-08 10:30:00",
"date_text": "2026年03月08日",
"date_description": "2小时前",
"summary": "文章摘要",
"url": "https://mp.weixin.qq.com/s/...",
"url_resolved": true
}
]
}
JSON field description:
title: Article titlesource: Source official account namedatetime: Article publication time (China time zone, format: YYYY-MM-DD HH:mm:ss)date_text: Date description (format: YYYY年MM月DD日)date_description: Relative time description (such as "2 hours ago", "1 day ago", "just now")summary: Article summaryurl: Article link (may be a real WeChat link or a Sogou redirect link)url_resolved: Whether it was successfully resolved to a real WeChat link (true/false)
Output description
- All links use the
[查看详情](<链接>)format, special characters can be handled correctly - Articles are sorted in descending order by publication time (newest first)
- Only articles from the last 60 days are displayed; older content is automatically filtered out
- Time is preferentially parsed from the timestamp in the page script tag; if there is no timestamp, then try to extract it from the text
Common issue handling
- Empty results: try changing the keyword, using fewer special characters, or retrying later
- Failed to resolve the real URL: this is normal (anti-crawling restrictions); you can prompt the user to open the intermediate link in a browser
Notes
- This tool is for learning and research purposes only; please do not use it for commercial purposes or large-scale crawling.
- When using this tool, please comply with the terms of use and regulations of the relevant websites.
- Excessive use may result in IP bans, so please use it with caution.