# Ra 公众号提取

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

- Repository: https://github.com/Pluviobyte/rnskill (1706 stars)
- Category: Writing
- License: see repository
- Last updated: 2026-09-21
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add Pluviobyte/rnskill --skill ra-公众号提取 -g -a claude-code -y`
Codex: `npx skills add Pluviobyte/rnskill --skill ra-公众号提取 -g -a codex -y`
Cursor: `npx skills add Pluviobyte/rnskill --skill ra-公众号提取 -g -a cursor -y`
Gemini CLI: `npx skills add Pluviobyte/rnskill --skill ra-公众号提取 -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add Pluviobyte/rnskill`

## Description

提取微信公众号文章全文。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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

```bash
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):

   ```bash
   python3 "$WX_HOME/scripts/fetch_wechat.py" --doctor
   ```

The rest: https://github.com/Pluviobyte/rnskill/blob/HEAD/skills/ra-公众号提取/SKILL.md
