WeChat-article-reader

将微信公众号文章导出为 Markdown 格式。当用户提供微信公众号链接 (mp.weixin.qq.com) 或要求下载/导出/保存微信文章时触发。默认保存到工作空间的 source 目录。

3,891 stars

Best use case

WeChat-article-reader is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

将微信公众号文章导出为 Markdown 格式。当用户提供微信公众号链接 (mp.weixin.qq.com) 或要求下载/导出/保存微信文章时触发。默认保存到工作空间的 source 目录。

Teams using WeChat-article-reader should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/wechat-article-reader/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/8421bit/wechat-article-reader/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/wechat-article-reader/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How WeChat-article-reader Compares

Feature / AgentWeChat-article-readerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

将微信公众号文章导出为 Markdown 格式。当用户提供微信公众号链接 (mp.weixin.qq.com) 或要求下载/导出/保存微信文章时触发。默认保存到工作空间的 source 目录。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 微信公众号文章导出技能 (WeChat-Article-Reader)

## 触发条件

当以下情况时触发此技能:

- 用户提供微信公众号文章链接 (mp.weixin.qq.com)
- 用户要求"下载"、"导出"或"保存"微信文章
- 用户要求将微信文章转换为 Markdown
- 用户提到"公众号文章"、"微信文章"、"下载微信"、"导出公众号"

**触发示例:**
- "下载这篇文章 https://mp.weixin.qq.com/s/xxx"
- "把这篇公众号文章导出为 markdown"
- "保存微信文章到本地"
- "帮我保存这篇微信文章"

## 工作原理

此技能使用 Python 脚本执行以下操作:
1. 获取微信文章 HTML 页面
2. 从 Open Graph 元标签提取元数据(标题、作者、发布时间)
3. 从 `#js_content` div 提取正文内容
4. 使用 markdownify 将 HTML 转换为 Markdown
5. 保存为带 YAML Front Matter 的 Markdown 文件

## 脚本目录

**基础目录**:`~/.npm-global/lib/node_modules/openclaw/skills/WeChat-article-reader`

**脚本位置**:`scripts/export.py`

## 安装设置

### 首次安装

1. **检查 Python 依赖**:
```bash
python3 -c "import requests, bs4, markdownify" 2>/dev/null || echo "需要安装依赖"
```

2. **如需安装依赖**:
```bash
pip3 install requests beautifulsoup4 lxml markdownify
```

### 无需配置

此技能开箱即用,无需 API Key 或额外配置。使用带浏览器头部的 HTTP 请求来获取微信文章。

## 执行步骤

当此技能被触发时,按以下步骤执行:

### 步骤 1:提取 URL

从用户请求中识别微信文章 URL。有效 URL 以以下开头:
- `https://mp.weixin.qq.com/s/`
- `https://mp.weixin.qq.com/...`

### 步骤 2:确定输出目录

默认输出目录:`~/.openclaw/workspace-qiming/source`

用户可以指定自定义输出目录。

### 步骤 3:运行导出脚本

```bash
# 如需要则创建输出目录
mkdir -p "$OUTPUT_DIR"

# 运行导出脚本
python3 ~/.npm-global/lib/node_modules/openclaw/skills/WeChat-article-reader/scripts/export.py "$URL" "$OUTPUT_DIR"
```

### 步骤 4:报告结果

告知用户:
- 成功或失败状态
- 输出文件路径
- 文章标题和元数据
- 任何错误或警告

## 命令示例

```bash
# 基本导出
python3 ~/.npm-global/lib/node_modules/openclaw/skills/WeChat-article-reader/scripts/export.py "https://mp.weixin.qq.com/s/xxx" ~/.openclaw/workspace-qiming/source

# 指定自定义输出目录
python3 ~/.npm-global/lib/node_modules/openclaw/skills/WeChat-article-reader/scripts/export.py "$URL" "/path/to/output"
```

## 输出格式

导出的 Markdown 文件包含:

```yaml
---
title: 文章标题
author: 作者名称
publish_time: 发布时间
source_url: 原文链接
exported_at: 导出时间戳
description: 文章描述
---

# 文章标题

> 原文链接: URL

**作者**: XXX
**发布时间**: XXX

-----

文章正文内容...
```

## 文件命名

生成的文件遵循格式:`YYYYMMDD_HHMMSS_文章标题.md`

标题中的特殊字符会被清理以确保文件系统兼容性。

## 常见问题与限制

### 常见问题

| 问题 | 原因 | 解决方案 |
|------|------|----------|
| "无法找到文章正文内容" | 文章需要登录或已被删除 | 尝试在浏览器中打开,或使用浏览器工具 |
| 连接超时 | 网络问题或限流 | 等待后重试,检查网络连接 |
| 编码问题 | 特殊字符 | 脚本自动处理 UTF-8 |

### 已知限制

- **需要登录的文章**:部分文章需要微信登录才能查看
- **反爬虫**:微信有反机器人措施,可能阻止频繁请求
- **图片**:不下载文章图片,仅保存 Markdown 文本
- **复杂格式**:可能无法完全保留所有格式

## 依赖项

| 包名 | 版本 | 用途 |
|------|------|------|
| requests | >=2.31.0 | HTTP 请求 |
| beautifulsoup4 | >=4.12.0 | HTML 解析 |
| lxml | >=4.9.0 | XML/HTML 解析器 |
| markdownify | >=0.11.6 | HTML 转 Markdown |

## 错误处理

脚本会:
- 打印清晰的中文错误信息
- 使用正确的状态码退出
- 优雅处理缺失的依赖
- 处理前验证 URL 格式

## 来源

基于 wechat-article-export 项目:
- GitHub: https://github.com/wechat-article/wechat-article-exporter
- 本 Skill 由 启明 创建

## 开源协议

MIT License

Related Skills

web-reader-pro

3891
from openclaw/skills

Advanced web content extraction skill for OpenClaw using multi-tier fallback strategy (Jina → Scrapling → WebFetch) with intelligent routing, caching, quality scoring, and domain learning. Use when: reading article content, extracting web page text, scraping dynamic JS-heavy pages, or fetching WeChat official account articles.

Data & Research

name: welight-wechat-layout-publish

3891
from openclaw/skills

description: Welight standalone skill for turning an article into WeChat Official Accounts compatible Markdown/HTML, presenting built-in theme choices, and publishing to WeChat as a draft or formal post when publishing prerequisites are already configured.

Content & Documentation

wechat-publisher

3891
from openclaw/skills

一键发布 Markdown 到微信公众号草稿箱。基于 wenyan-cli,支持多主题、代码高亮、图片自动上传。

Content & Documentation

wechat-mp-reader

3891
from openclaw/skills

Read WeChat official account articles. Use the built-in browser tool to open the page and extract body text. Always append ?scene=1 to the URL.

rss-ai-reader

3891
from openclaw/skills

📰 RSS AI 阅读器 — 自动抓取订阅、LLM生成摘要、多渠道推送! 支持 Claude/OpenAI 生成中文摘要,推送到飞书/Telegram/Email。 触发条件: 用户要求订阅RSS、监控博客、抓取新闻、生成摘要、设置定时抓取、 "帮我订阅"、"监控这个网站"、"每天推送新闻"、RSS/Atom feed 相关。

clawphone-wechat-control

3891
from openclaw/skills

处理微信会话列表、进入聊天、发送消息、处理微信内弹窗与聊天页失败排查。适用于用户要求查看微信消息、回复联系人、转发、处理聊天输入框或发送失败时。执行时必须先确认当前在微信的哪个页面,再按聊天场景一步一验。

wechat-content-creator

3891
from openclaw/skills

Create high-quality WeChat public account articles with high eCPM. Use when writing WeChat articles, optimizing titles, selecting topics, or improving content quality. Covers 8 golden opening templates, SCQA structure, long-tail keyword integration, high-value niches like legal, finance, career, and compliance guidelines. Triggers on requests like write WeChat article, 公众号文章, 爆款文案, title optimization, 选题, eCPM optimization, or 长尾关键词.

save-article-with-images

3891
from openclaw/skills

Save web articles locally with images. Automatically downloads images, generates Markdown, and converts to PDF. Supports WeChat Official Account articles via subagent isolation. Triggers: save article, save this article, download article, clip article, wechat article.

name: wechat_messaging

3891
from openclaw/skills

description: 通过微信向好友发送消息。流程:查询好友 -> 确认目标 -> 发送内容。

name: wechat_operate

3891
from openclaw/skills

description: 通过微信进行社交管理与消息发送。流程:查询目标(好友/群聊/成员) -> 确认目标 -> 发送内容(文本/图片/文件)。

DeepReader

3891
from openclaw/skills

The default web content reader for OpenClaw. Reads X (Twitter), Reddit, YouTube, and any webpage into clean Markdown — zero API keys required. Use when you need to ingest social media posts, articles, or video transcripts into agent memory.

wechat-comic-factory

3891
from openclaw/skills

Generate WeChat comic articles and publish them to the WeChat Official Account draft box by executing local Python pipeline scripts. Use when the user wants to create a comic series from comic_type, topic, and count, or publish the latest generated task. In this skill, “发布” and “发微信” always mean only pushing to the WeChat Official Account draft box; never reinterpret them as personal chat, group chat, or message-tool sending.