WeChat MP Reader
by @nasplycc
Fetch WeChat Official Account articles from either a public account name or a WeChat article URL. Use when the user wants to extract full article content, id...
clawhub install nasply-wechat-mp-reader📖 About This Skill
name: wechat-mp-reader description: Fetch WeChat Official Account articles from either a public account name or a WeChat article URL. Use when the user wants to extract full article content, identify the account behind an article, list recent or historical articles for an account, or build article archives from WeChat public accounts. Prioritize article-URL-based resolution first, then account-name search, with graceful fallback when search is unreliable.
WeChat MP Reader
Use this skill for 微信公众号文章抓取、公众号反查、文章列表拉取、全文提取。
What this skill should do
Support these user intents:
Operating principles
1. URL-first is the default path. If the user gives an article URL, resolve from it first.
2. Name search is best-effort. If account-name search is unreliable, ask for any article URL from that account.
3. Full text matters more than stats. Article extraction is core; read/like stats are optional.
4. Use layered fallbacks. Try plain HTTP first, but for WeChat articles treat browser fallback as normal whenever the page looks non-canonical (verification page, shell page, or mixed JS page). The current fallback is local Playwright WebKit only.
5. Keep outputs structured. Return normalized account/article objects rather than loose text.
6. Recover fakeid via search when needed. Article pages often expose biz/account name, but not a stable fakeid; when MP backend session is available, try search-based recovery.
7. Treat session validity as first-class state. Report whether session is present/valid, instead of hiding failures in generic warnings.
Default workflow
Path A — article URL provided
1. Parse the article URL and extract__biz, mid, idx, sn.
2. Fetch the article page.
3. Extract account metadata from HTML / embedded JS.
4. Load MP backend session from env or session file.
5. Validate session and report session.present / session.valid / session.reason.
6. If fakeid is missing and session is valid, search by account name and match candidates using biz / name.
7. Extract and clean full article content.
8. If requested and fakeid is available, list more articles for that account.Path B — account name provided
1. Load and validate MP backend session. 2. Attempt account-name search via the search adapter. 3. Return ranked candidates. 4. If a confident match exists, fetch article list. 5. If search fails or is ambiguous, ask for any article URL from that account and switch to Path A.Path C — session operations
Use the bundled CLI to:session check — validate current env/file-backed sessionsession show — report non-sensitive session presence/length/statussession save — persist env-provided session to local cache filesession login-start — start QR login, return scan state, and write a real scannable QR PNG under scripts/cache/wechat-login-qr-real.pngsession login-status — poll login status and capture fresh session when readyExpected outputs
Session object
{
"present": true,
"valid": false,
"reason": "invalid session",
"base_resp": {}
}
Account object
{
"name": "",
"biz": "",
"fakeid": "",
"avatar": "",
"signature": ""
}
Article object
{
"title": "",
"url": "",
"publish_time": "",
"publish_time_raw": "",
"author": "",
"account_name": "",
"content_html": "",
"content_markdown": "",
"images": []
}
Implementation notes
scripts/wechat_mp_reader.py.session check, session login-start, session login-status) and then run article --with-account-articles directly via scripts/wechat_mp_reader.py; helper bridge scripts are no longer the default path.session login-start now persists a real scannable QR image to scripts/cache/wechat-login-qr-real.png and returns its path in qr_image_path.biz / name -> fakeid) locally to reduce repeated searchbiz lookups.Files to use
scripts/wechat_mp_reader.py — Python prototype and CLIscripts/wechat_mp_reader/auth.py — session validation helpersscripts/wechat_mp_reader/session_store.py — session load/save helpersreferences/design.md — architecture, implementation phases, and caveatsRead references/design.md when you need the detailed design, adapter responsibilities, or future roadmap.
Read references/usage.md when you need the human-facing usage guide, CLI examples, or natural-language invocation patterns for triggering this skill through an agent.