CommunityResearch & Data Analysisgithub.com

Larkin0302/mp-data

WeChat Official Account Data Scraping Claude Code Skill — Scan to log in, scrape full article data, and generate visual analysis reports

What is mp-data?

Larkin0302/mp-data is a specialized Claude Code skill designed for developers and data analysts who need to extract and analyze data from WeChat Official Accounts (公众号). The skill automates the entire workflow: from scanning a QR code to log into the WeChat platform, to scraping all published articles with metadata (title, date, views, likes, etc.), and finally generating a comprehensive visual analysis report (e.g., bar charts, trend lines, word clouds). It supports the Claude Code environment and uses Playwright for browser automation to handle login cookie persistence and anti-scraping measures. This skill is particularly useful for content strategists, marketers, and researchers who need to monitor competitor accounts or analyze their own publication performance without manual data collection. The provided SKILL.md includes detailed instructions for setup, usage, and troubleshooting, ensuring even non-experts can execute complex data scraping tasks with minimal effort.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add Larkin0302/mp-data

Installed? Explore more Research & Data Analysis skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does mp-data do?

微信公众号数据抓取 Claude Code Skill — 扫码登录即可抓取全量文章数据并生成可视化分析报告

功能概述

本Skill允许你通过Claude Code在终端中直接抓取任意微信公众号的历史文章数据,并自动生成可视化分析报告。只需扫码登录一次,后续所有抓取均自动完成。

前置条件

  • 安装 Node.js (v16+) 和 npm
  • 安装 Playwright: npm install -g playwright && npx playwright install chromium
  • 一个有效的微信账号

使用方法

1. 初始化环境

在你的项目目录中运行:

npm install playwright axios chart.js

2. 配置目标公众号

编辑 config.json 文件:

{
  "target_account": "公众号名称",
  "max_articles": 100,
  "output_format": "html"
}

3. 运行抓取

在Claude Code中输入:

请抓取公众号“目标名称”的最新50篇文章并生成分析报告

Claude将自动:

  1. 打开浏览器并显示登录二维码(首次使用)
  2. 等待你扫码登录
  3. 进入公众号主页抓取文章列表
  4. 提取每篇文章的标题、发布时间、阅读量、点赞数等
  5. 生成可视化报告(HTML文件)

输出示例

报告文件将保存在 reports/ 目录下,包含:

  • 文章发布时间分布图
  • 阅读量Top10排行榜
  • 关键词词云
  • 综合数据统计表

注意事项

  • 使用频率过快可能触发微信风控,建议每次抓取间隔至少5分钟
  • Cookie有效期约24小时,过期需重新扫码
  • 请遵守微信公众平台服务条款,仅用于个人或合法研究目的

故障排除

  • 如果扫码后无法登录,尝试清除缓存:rm -rf ./playwright-cache
  • 确保Chrome/Chromium最新版本
  • 报告无法生成时检查Node.js版本

许可证

MIT

Related Skills