- Author: Daniel Li
- Copyright © Daniel Li. All rights reserved.
Integrates four major functional modules:Search → Download → Rewrite → Publish, covering the entire workflow of Official Account content creation.
Module Overview
| Module | Function | Example Trigger Words |
|---|---|---|
| 🔍 Search | Search Official Account articles by keyword | "Search for Official Account articles about XX" |
| 📰 Download | Download article content/images/videos | "Download this Official Account article" |
| ✍️ Rewrite | AI de-tracing + original rewriting | "Help me rewrite/adapt this article" |
| 📱 Publish | Publish Markdown to drafts | "Publish to Official Account" |
🔍 Module 1: Article Search
Get a list of Official Account articles through Sogou WeChat search, with support for scraping the body text.
First-time dependency installation
npm install -g cheerio
Usage
# 基础搜索
node {baseDir}/scripts/search/search_wechat.js "关键词"
# 指定数量
node {baseDir}/scripts/search/search_wechat.js "关键词" -n 15
# 保存到文件
node {baseDir}/scripts/search/search_wechat.js "关键词" -n 20 -o result.json
# 解析真实链接
node {baseDir}/scripts/search/search_wechat.js "关键词" -n 5 -r
# 抓取文章正文(自动启用 -r)
node {baseDir}/scripts/search/search_wechat.js "关键词" -n 5 -c
Parameter Description
query: Search keyword (required)-n, --num: Number of results to return (default 10, maximum 50)-o, --output: Output JSON file path-r, --resolve-url: Parse the real link of the WeChat article-c, --fetch-content: Scrape the article body content (automatically enables -r)
Output Fields
- Article title, address, summary, publish time, source Official Account
content: Body content (when using -c)word_count: Word count (when using -c)
📰 Module 2: Article Download
Enter an Official Account article link to automatically download the content (Markdown+HTML), images, and videos.
First-time dependency installation
cd {baseDir}/scripts/downloader && npm install
Before downloading: confirm the save location
# 查看当前配置
node {baseDir}/scripts/downloader/download.js --show-config
# 设置默认下载路径(仅需一次)
node {baseDir}/scripts/downloader/download.js --set-output ~/Downloads/wechat-articles
"isDefault": true→ Not yet configured, need to ask the user"isDefault": false→ Already configured, inform the user of the current path
Download article
# 使用默认路径
node {baseDir}/scripts/downloader/download.js "<文章URL>"
# 临时指定路径
node {baseDir}/scripts/downloader/download.js "<文章URL>" --output <临时目录>
# 跳过图片/视频
node {baseDir}/scripts/downloader/download.js "<文章URL>" --no-image
node {baseDir}/scripts/downloader/download.js "<文章URL>" --no-video
Output Structure
<下载目录>/<文章标题>/
├── content/article.html # 完整 HTML
├── metadata.json # 标题、作者、时间等
├── images/ # 所有配图
└── videos/ # 所有视频/音频
Prerequisites
- Node.js ≥ 18、Google Chrome、
npm install(first time)
✍️ Module 3: Article Rewriting and Adaptation
Rewrite articles into a natural, original style, remove traces of AI writing, and improve originality.
Trigger Words
- "Help me rewrite this article"
- "Rewrite it into original content"
- "Lower the plagiarism check rate"
- "Remove the AI flavor"
Rewriting Workflow
Standard Rewriting Process
- Obtain the original text — Obtain the original text through search (-c scrapes the body) or download
- Analyze the structure — Identify the article type, core arguments, and paragraph hierarchy
- Deep rewriting — Perform the rewriting according to the following strategies
- Add frontmatter — Add title + cover
- Publish — Push to the Official Account drafts
Rewriting Strategies
A. Structural Reorganization (core of reducing duplication)
- Paragraph rearrangement: Adjust the order of paragraphs and disrupt the original structure
- Paragraph splitting and merging: Split long paragraphs into short ones, or merge fragmented paragraphs
- Narrative perspective shift: Timeline ↔ Problem-oriented ↔ Comparative analysis ↔ Story introduction
- Argument reorganization: Keep the core arguments, change the way they are developed
B. Language rewriting (removing AI traces)
- Delete meaning-inflated sentences: "iconic", "milestone", "far-reaching impact" → replace with specific facts
- Remove false authority: "experts believe", "the industry generally believes" → state the source or delete
- Remove pseudo-deep verbs: "enhance capabilities", "empower", "advance the process" → change to specific actions
- Remove advertising tone: "outstanding", "ultimate experience", "all-around" → objective description
- Remove high-frequency AI words: empower, closed loop, ecosystem, lever, underlying logic, paradigm, consolidate, momentum
- Remove filler phrases: in fact, it is worth noting that, overall, it is not hard to find
- Remove empty endings: "the future is promising", "worth looking forward to" → actual conclusion or action item
C. Title rewriting
Generate 3-5 alternative titles for each article, covering:
- Question type: Use questions to spark curiosity ("Why is XX still using this method?")
- Number type: Use numbers to enhance credibility ("3 overlooked XX techniques")
- Suspense type: Create an information gap ("The truth about XX, 90% of people don't know")
- Pain point type: Hit the reader's pain point ("Stop XX, try this method")
D. Opening rewriting
Convert the original opening into one of the following styles:
- Story introduction: Start with a short story or scene
- Data introduction: Start with striking data
- Pain point introduction: Directly address the reader's troubles
- Rhetorical question introduction: Pose a counterintuitive question
E. SEO optimization (optional)
- Naturally incorporate core keywords into the title and first paragraph
- Distribute long-tail keywords in subheadings
- Control keyword density (2%-5%), keep it natural and readable
AI trace identification checklist
After rewriting is complete, check item by item:
| # | Check item | Handling method |
|---|---|---|
| 1 | Meaning-inflated sentences | Replace with specific facts |
| 2 | False authority references | State the source or delete |
| 3 | Pseudo-deep verbs | Change to specific actions |
| 4 | Advertising tone | Objective description |
| 5 | Template paragraphs (challenge → opportunity → outlook) | Delete the template, keep the conclusion |
| 6 | Dense appearance of high-frequency AI words | Replace with everyday language |
| 7 | Abuse of negative parallelism (not only... but also...) | Express directly |
| 8 | Forced three-part structure | Keep the key points, delete filler items |
| 9 | Mechanical synonym rotation | Use fixed wording for the same concept |
| 10 | Abuse of dashes | Change to periods or commas |
| 11 | Excessive use of bold emphasis | Remove unnecessary emphasis |
| 12 | List template (X:…) | Merge into natural paragraphs |
| 13 | Concept-stacking titles | Change to conversational titles |
| 14 | Emoji overload | Delete by default unless a style is specified |
| 15 | Chat-speak remnants | Delete |
| 16 | Knowledge cutoff disclaimer | Delete |
| 17 | Overly sycophantic tone | Respond objectively |
| 18 | Filler phrases | Delete |
| 19 | Overly vague (might, perhaps) | Change to conditional judgments |
| 20 | Empty conclusion | Change to an actual conclusion |
| 21 | False range expressions (from...to...) | List specific facts |
Output format
- Full rewritten text(Markdown format, including frontmatter)
- Alternative titles(3-5)
- Revision notes(Optional, briefly list the main changes)
Judgment criteria
Signs of a successful rewrite:
- ✅ Reads like it was written by a real person, and can be read aloud smoothly without sounding awkward
- ✅ No empty sentences, template paragraphs, or "AI-like" smell
- ✅ High information density, every sentence has concrete content
- ✅ The structure is clearly different from the original text
- ✅ Preserves the integrity of the original text's core information
📱 Module 4: Article publishing
One-click publish Markdown to the WeChat Official Account drafts box, based on wenyan-cli.
First-time installation
npm install -g @wenyan-md/cli
Configure API credentials
Make sure the environment variables are set (or configured in TOOLS.md):
export WECHAT_APP_ID=your_wechat_app_id
export WECHAT_APP_SECRET=your_wechat_app_secret
Important: The IP must be in the WeChat Official Account backend whitelist!
Markdown format requirements
At the top of the filemustinclude complete frontmatter:
---
title: 文章标题(必填!)
cover: https://example.com/cover.jpg # 封面图(必填!)
---
# 正文...
⚠️ title and cover both are indispensable, otherwise an error will be reported.
⚠️ Image paths must use absolute paths, to avoid wenyan path resolution issues. This includes cover and all image references in the body:
cover: /Users/minruiqing/photos/cover.jpg # ✅ 绝对路径
cover: ./assets/cover.jpg # ❌ 相对路径可能出错
 # ✅ 绝对路径
 # ❌ 相对路径可能出错
Illustration generation
Before publishing,proactively ask the user whether they need illustrations generated:
📸 The article is ready! Do you need me to help you generate illustrations?
- Cover image (cover, recommended 1080×864)
- Body illustrations (generated based on paragraph themes)
- No need, publish directly
If the user needs illustrations:
- Based on the article title and content, generate appropriate image description prompts
- Call the user-providedimage generation skill(such as doubao-image, openai-image-gen, etc.) to generate images
- Save the generated images to the article directory, usingabsolute pathsfor reference
- Set the cover image to the frontmatter's
coverfield - Insert body illustrations at appropriate positions

Prompt suggestions:
- Cover image: strongly related to the title, concise and impactful, suitable for small-size previews
- Body illustration: consistent with the corresponding paragraph content, aids understanding
Publishing method
# 方式 1: 使用 publish.js
node {baseDir}/scripts/publisher/publish.js /path/to/article.md
# 方式 2: 直接用 wenyan-cli
wenyan publish -f article.md -t lapis -h solarized-light
# 方式 3: stdin(推荐,解决路径问题)
# macOS/Linux:
cat "/path/to/article.md" | WECHAT_APP_ID=xxx WECHAT_APP_SECRET=xxx wenyan publish -t lapis -h solarized-light
# 方式 4: 含视频文章(必须用这个)
node {baseDir}/scripts/publisher/publish_with_video.js /path/to/article.md
Theme options
Built-in themes:default、lapis(recommended),phycat
Code highlighting:atom-one-dark、dracula、github、monokai、solarized-light(recommended),xcode
wenyan publish -f article.md -t lapis -h solarized-light
wenyan theme -l # 查看所有主题
Video embedding (critical)
WeChat videos must use the iframe + data-mpvid format,publish_with_video.js this logic is already built in.
Reference in Markdown:
 # 自动上传并嵌入
Troubleshooting
| Issue | Solution |
|---|---|
| IP not in whitelist | curl ifconfig.me → add to the official account backend |
| wenyan not installed | npm install -g @wenyan-md/cli |
| Environment variable not set | export WECHAT_APP_ID=xxx |
| Missing frontmatter | Add title + cover |
| 40001 token invalid | Use publish_with_video.js(token management already built in) |
Complete workflow example
Search → rewrite → publish
1. 搜索文章:node {baseDir}/scripts/search/search_wechat.js "AI教程" -n 5 -c
2. 选择目标文章,执行洗稿改写
3. 保存为 Markdown(含 frontmatter)
4. 发布:node {baseDir}/scripts/publisher/publish.js article.md
Download → rewrite → publish
1. 下载文章:node {baseDir}/scripts/downloader/download.js "https://mp.weixin.qq.com/s/xxx"
2. 读取下载的 HTML/Markdown,执行洗稿改写
3. 保存为 Markdown(含 frontmatter)
4. 发布:node {baseDir}/scripts/publisher/publish.js article.md
Notes
- All tools are for personal learning use only, please comply with copyright laws
- The search function has built-in anti-ban mechanisms (random UA, request delay), please do not use it at high frequency
- Configuration file: downloader
{baseDir}/scripts/downloader/config.json