Skip to content

michaelzhang1987/wx-article-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wx-article-export

WeChat 微信公众号文章全量导出 Skill — 通过 WeRSS API 采集文章链接,使用 Edge + 易微信插件批量下载为 Markdown + 图片 ZIP。

功能

  • 全量采集 — 遍历 161 个公众号,按版权过滤(原创+未声明,排除转载),生成 export_config.json
  • 并行导出 — 单浏览器上下文,N 个标签页共享工作队列,同时下载多篇文章
  • 断点续传 — 崩溃重启自动跳过已完成文章
  • 故障检测 — 自动识别并跳过已删除/谣言/隐私限制/临时不可访问的文章
  • 交叉对比 — 转载文章 vs 已下载文章标题匹配分析

前置条件

软件 要求
Node.js v18+
Python 3.8+ (仅采集步骤需要)
Edge 浏览器 Windows 自带
易微信插件 Edge 扩展商店搜索 "易微信-微信文章助手" (v2.0.3)
Playwright npm install playwright

快速开始

# 1. 安装依赖
npm install

# 2. 全量采集(从 WeRSS API 获取所有文章链接)
python scripts/collect_all.py

# 3. 并行导出(10 个标签页同时下载)
node scripts/export_parallel.js 10

# 4. 查看进度
node -e "const c=require('./export_config.json'); let d=0,t=0; for(const a of c) for(const x of a.articles){t++; if(x.exported) d++} console.log(d+'/'+t+' ('+(d/t*100).toFixed(1)+'%)')"

安装为 Claude Code Skill

# 克隆到 Claude Code skills 目录
git clone https://github.com/michaelzhang1987/wx-article-export.git ~/.claude/skills/wx-article-export

# 在 Claude Code 中自动生效,或手动加载
# 之后直接对 Claude 说 "导出公众号文章" 即可

目录结构

wx-article-export/
├── SKILL.md                     # 技能定义文件
├── README.md                    # 本文件
├── CHANGELOG.md                 # 版本变更记录
├── package.json                 # Node 依赖
├── .gitignore
├── scripts/                     # 执行脚本
│   ├── collect_all.py           # 全量采集(主推荐)
│   ├── collect_via_api.js       # API 采集备选
│   ├── collect_urls.js          # RSS 采集备选
│   ├── export_parallel.js       # 多页面并行导出(主推荐)
│   ├── export_batch.js          # 按公众号导出(旧版保留)
│   └── gen_unmatched_repost_report.js  # 转载交叉对比
├── evaluations/                 # 历史评估数据
│   ├── iteration-1/
│   └── iteration-2/
└── exports/                     # 导出文件(gitignore)

脚本说明

脚本 用途 推荐度
collect_all.py 遍历全部公众号,按版权过滤,合并进度 ★★★ 推荐
export_parallel.js 单浏览器 N 页面并行导出,共享队列 ★★★ 推荐
collect_via_api.js JS 版采集,支持交互筛选、日期/原创过滤 ★★ 备选
export_batch.js 按公众号逐号导出(可并行号) ★★ 旧版保留
gen_unmatched_repost_report.js 转载文章标题 vs 已下载交叉对比 ★ 分析工具
collect_urls.js RSS 采集,无需登录 ★ 备选

许可

MIT

About

WeChat article export skill for Claude Code — parallel batch download via Edge + 易微信 plugin

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors