web-to-wechat-draft
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "web-to-wechat-draft" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7973bc254d7853b93a087b3412703f8f78b007389ea381653afa56b315b8069d. Verify the upstream source and version against https://skillhub.cn/skills/user_656c2e70/web-to-wechat-draft before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Web-to-WeChat Draft: Fetches content from Xueqiu or other web pages, formats it as Markdown, and saves it directly into the WeChat official account draft box via the API (no mass sending, no browser login). Adds browser auto-start and post-publish self-check features, suitable for unattended automated workflows.
Introduction source: third_party · user_656c2e70 · 1.2.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: web-to-wechat-draft
description: >
抓取网上资料(雪球/微博/网页等)、整理为带层级结构的 Markdown、并通过微信公众号草稿箱 API
直接发布到草稿箱(不自动群发),保留标题/小标题/引用/列表/加粗格式、自动去除“AI 抓取痕迹”等可疑文案。
纯 API 实现,无需浏览器、无需扫码登录。
当用户说“把某人的发言/某篇资料整理发到公众号草稿”“发公众号(保留格式)”
“整理雪球发言发公众号”“把网上资料发到公众号”“发布到公众号草稿箱”等时使用。
前置:已配置 MP_APPID/MP_APPSECRET 且公众号 IP 白名单已加本机出口 IP。Web → 公众号草稿箱(纯 API 版)
把任意网上资料整理成带格式的微信公众号图文,通过 draft.add 接口存入草稿箱。
完全不依赖浏览器(无需 bsk、无需扫码),适合无人值守自动化。
前置条件
- 公众号已完成微信认证(草稿箱接口仅对认证号开放)。
- 已配置凭证(二选一):
- 环境变量
MP_APPID/MP_APPSECRET;或 - 本地文件
~/.workbuddy/mp_credentials.json:{"appid":"...","secret":"..."}
- 环境变量
- 公众号「设置与开发 → 基本配置 → IP白名单」已加入调用方出口 IP
(否则
cgi-bin/token返回errcode 40164)。云端跑的自动化要确认其出口 IP 也在白名单。
完整流程
0. 启动浏览器与插件(抓取前必做,确保自动化可无人值守)
发布虽是纯 API,但抓取雪球/网页常用 BrowserSkill(bsk)驱动本机 Edge。
若运行时浏览器没连上 daemon,bsk session start 会失败。先用本技能自带脚本把
浏览器和 BrowserSkill 扩展自动拉起:
python scripts/launch_browser.py
# 输出「>> 浏览器已连上 daemon」即表示 BrowserSkill 扩展已就绪,随后抓取步骤再 bsk session start
脚本逻辑:探测 bsk status → 未连上则启动本机 Edge(扩展随浏览器自启并自动连
daemon)→ 轮询等待连上。连上返回 0;仍连不上返回 3 并提示人工确认扩展状态。
会话创建(bsk session start)由抓取步骤独立完成,本脚本不做(避免阻塞)。
1. 抓取资料(用上面建好的会话)
抓取雪球/网页可用 BrowserSkill(bsk)或直接 WebFetch,取决于来源。
雪球段永平正确账号:大道无形我有型,ID 1247347556(勿混淆 1290568231 那位粉丝)。
抓取这一步与发布解耦——发布走 API,不需要保持浏览器登录态(浏览器只在抓取阶段用)。
2. 整理 Markdown(由你完成)
把抓取内容整理成结构化 Markdown,并删除 AI 嫌疑文案:
- 保留层级:
#标题、>引用、-列表、1.有序列表、**加粗**、*斜体*、`代码`、代码块。 - 必须剔除:“数据来源:…经 BrowserSkill 抓取”“本文由 AI 整理”“抓取于…实时快照” 以及任何暴露“这是机器自动抓的/AI 写的”的句子。改成自然口吻(如“以下是今日的发言整理:”)。
3. 发布到草稿箱(核心,纯 API)
# 从 Markdown 文件发布
python scripts/draft_api.py --title "段永平今日发言(2026-07-09)" --md 发言.md
# 或从字符串发布(dry-run 只输出 HTML 不调用接口,方便调试格式)
python scripts/draft_api.py --title "标题" --content "# 正文
> 引用" --dry-run
脚本内部流程:
md_to_html()把 Markdown 转成微信允许的 HTML(h1-h3/p/blockquote/ul/ol/li/strong/em/code/img/a/hr/br)。- 读凭证 →
cgi-bin/token拿access_token。 - 封面:无
--cover时自动生成渐变 PNG 并material/add_material上传,缓存thumb_media_id(同级.cover_media_id文件,永久素材可复用);有--cover则用指定图。 cgi-bin/draft/add建草稿,输出SUCCESS media_id=...即入草稿箱(未群发)。- 自检:立即用
cgi-bin/draft/get把刚建的草稿读回来,确认标题/正文已落库,打印>> 自检通过:草稿箱已存在《xxx》。读不回会打印自检警告,便于发现"假成功"。
4. 校验与兜底
- 成功:打印
media_id+ 自检通过,草稿出现在公众号后台「草稿箱」。 - 失败按 errcode 提示(见
references/api_notes.md):40164→ IP 白名单没加;48001→ 账号未认证;40013/40125→ AppID/Secret 错或已被重置。
- 兜底建议:若 API 不可用(白名单未配/凭证缺失),把整理好的 Markdown 存到本地
段永平发言_YYYY-MM-DD.md并标记“待发布”,不阻断上游抓取任务。
关键脚本
| 脚本 | 作用 |
|---|---|
scripts/draft_api.py |
纯 API 发布器:Markdown→HTML、拿 token、上传封面、draft.add、发布后自检 |
scripts/launch_browser.py |
抓取前自启动 Edge + BrowserSkill 扩展,确保 daemon 连上并返回会话 id |
深度参考
- 微信草稿箱 API、IP 白名单、封面必填、errcode 速查:
references/api_notes.md
调用约定(必看)
- 凭证绝对不要写进技能文件或上传到 SkillHub 市场;只走环境变量
MP_APPID/MP_APPSECRET, 或本地~/.workbuddy/mp_credentials.json(用户私有目录,不上传)。 - 正文图片用外部 URL 多数账号会被过滤,纯文字稿不受影响;如需插图,先
material/add_material上传再引用返回的 weixin URL。 - 文件编码全程 UTF-8。
scripts/下所有脚本均不含任何 appid/appsecret 明文。
Current listing version
1.2.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决公众号内容自动化整理与发布的特定场景痛点
- 适合无人值守自动化,无需浏览器登录
Highlights
- 触发词覆盖多种变体,边界清晰
- 前置条件说明清楚,降低误触风险
Areas to improve
-
缺少端到端完整示例 Reported severity: Minor
已有脚本调用示例,但缺少从抓取到发布的完整流程示例
Recommendation: 建议补充一个从抓取雪球发言到发布到草稿箱的完整端到端示例
Highlights
- Phase/步骤清晰,有出口条件和校验机制
- frontmatter 完整,调用约定明确
Highlights
- 使用微信官方 API,工具来源明确
- 覆盖主要异常场景,有自检和兜底机制
- 凭证管理安全,不暴露敏感信息
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 69
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.