Skills

Ra 公众号提取

提取微信公众号文章全文。Use when the user provides a mp.weixin.qq.com URL and asks for 提取文章, 抓取公众号...

Install

npx skills add Pluviobyte/rnskill --skill ra-公众号提取 -g -a claude-code -y
Repository
Pluviobyte/rnskill1.7k
Category
Writing
Updated
1mo ago
License
See repository
Context cost
Lightabout 972 tokens
Runs scripts
Yes, review before use

What it does

提取微信公众号文章全文。Use when the user provides a mp.weixin.qq.com URL and asks for 提取文章, 抓取公众号, 读一下这篇, or when another skill (ra-洗稿, ra-选题, ra-video-wash-pipeline) needs to read a WeChat article before processing. Uses MicroMessenger UA spoofing to bypass WeChat's first-layer access control. Stdlib only, no API key required.

ra-公众号提取

Goal

Extract the full text of a WeChat public account article into clean Markdown, ready for downstream skills.

This skill is intentionally narrow:

  • fetch the article HTML with a spoofed WeChat UA
  • parse title, author, publish time, and body text
  • write a Markdown file to 01-内容生产/视频工作台/.internal/公众号/
  • print the complete text in the conversation

Do not summarize, rewrite, translate, title, or start production. Hand the extracted text to the calling skill or user.

Locate The Skill

WX_HOME="$(
  for d in "$(pwd)/.codex/skills/ra-公众号提取" \
           "$(pwd)/.agents/skills/ra-公众号提取" \
           "$(pwd)/.claude/skills/ra-公众号提取" \
           "$HOME/.codex/skills/ra-公众号提取" \
           "$HOME/.agents/skills/ra-公众号提取" \
           "$HOME/.claude/skills/ra-公众号提取"; do
    [ -f "$d/SKILL.md" ] && echo "$d" && break
  done
)"
export WX_HOME

Use "$WX_HOME/scripts/fetch_wechat.py" for every operation.

How It Works

WeChat blocks external access to public account articles through several layers:

  1. User-Agent detection, checks for MicroMessenger keyword; rejects normal browser UAs
  2. Referer check, expects requests from mp.weixin.qq.com
  3. JS lazy-loading, images use data-src instead of src
  4. Rate limiting, frequent requests trigger CAPTCHA

This skill bypasses layer 1 and 2 by sending a request with a genuine WeChat iOS WebView User-Agent and the correct Referer header. This is sufficient to receive the full article HTML for text extraction. No login, cookie, or API key is needed.

Limitations:

  • Images are extracted as URLs only (from data-src), not downloaded
  • Some articles with heavy JS rendering may return partial content
  • Rapid successive calls from the same IP may trigger CAPTCHA (wait and retry)
  • Does not work on articles that require WeChat login or payment

Workflow

  1. Health check (optional):

    python3 "$WX_HOME/scripts/fetch_wechat.py" --doctor
    
Read the whole SKILL.md on GitHub

More in Writing