mcpField
W
wechat-article-reader

wechat-article-reader

github.com/pangahnProductivity1214 installsUpdated 32w ago
Repository

About wechat-article-reader

A skill that reads WeChat public-account article links and returns structured metadata and text. It is intended for workflows that need article extraction with retry handling and diagnostic logs.

Key features

  1. 01Parse title, author, and time
  2. 02Extract plain-text content
  3. 03Retry failed network requests
  4. 04Return strategy and execution logs
  5. 05Provide results as JSON

Use cases

  1. 01Extract a WeChat article's text
  2. 02Retrieve article author and publication time
  3. 03Diagnose article retrieval failures

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pangahn/wechat-article-reader --skill wechat-article-reader

After installing, type/wechat-article-readerin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

requirements.txt
.gitignore
uv.lock
pyproject.toml
scripts/
read_wechat_article.py

Details

From the project README

WeChat Article Reader

用于读取微信公众号文章链接并返回结构化解析结果。

⚠️ 重要:模型行为约束

只要用户提供了 mp.weixin.qq.com 域名下的文章链接,必须且只能使用本 skill 读取内容。

严禁以下替代行为:

  • 使用 web_fetch 直接请求微信文章 URL
  • 使用 web_search 搜索文章摘要
  • 告知用户"无法访问该链接"后放弃
  • 尝试从其他来源推断文章内容

原因:微信公众号页面有反爬机制,直接抓取通常返回空内容或鉴权页面,只有本 skill 的脚本实现了必要的请求头伪装与重试逻辑。


适用场景

  • 用户提供了 https://mp.weixin.qq.com/s/... 公开文章链接
  • 需要稳定抓取并解析标题、时间、作者、正文
  • 需要在网络波动时使用重试机制

环境准备

本 skill 仅允许通过 uv 管理环境与执行脚本。

若 uv 未安装,先执行:

brew install uv

再安装项目依赖:

uv sync

运行命令

必须使用 uv run 执行,禁止直接使用 python scripts/read_wechat_article.py ...。

uv run python scripts/read_wechat_article.py "https://mp.weixin.qq.com/s/..."

参数说明

参数默认值说明
--timeout20单次请求超时秒数
--max-retries3最大尝试次数
--retry-delay1.0重试基准等待秒数(指数退避)

输出说明

成功时返回 JSON:

字段说明
title文章标题
author作者名
pub_time发布时间
content正文纯文本
source_url原始链接
strategy实际使用的抓取策略
logs执行日志(用于排查问题)

失败时返回:

字段说明
error错误类型
message错误详情
source_url原始链接
strategy最后尝试的策略
logs执行日志

Comments

Markdown supported