Skip to content
← Back to skills

微信公众号文章

Research

搜索任意公众号、获取文章列表和全文内容

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/tuyoogame/tyclaw.rs/blob/HEAD/workspace/skills/office/wechat-article/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/微信公众号文章, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

微信公众号文章

搜索任意微信公众号,获取文章列表和全文内容。

前提

首次使用或凭证过期时,tool 会自动输出绑定链接。用户点击链接、用公众号管理员微信扫码即可完成绑定(与钉钉 OAuth 同一体验),凭证有效期约 4 天。

工具用法

skills/office/wechat-article/tool.py

常用命令

# 检查登录状态
python3 skills/office/wechat-article/tool.py status

# 搜索公众号
python3 skills/office/wechat-article/tool.py search --query "公众号名称"

# 获取文章列表(需先搜索获取 fakeid)
python3 skills/office/wechat-article/tool.py list --fakeid MjM5OTc2ODUxMw== --count 10

# 获取文章全文
python3 skills/office/wechat-article/tool.py read --url "https://mp.weixin.qq.com/s/xxxxx"

# 在公众号内搜索关键词
python3 skills/office/wechat-article/tool.py list --fakeid MjM5OTc2ODUxMw== --keyword "关键词"

参数速查

search 子命令

参数说明必须
--query搜索关键词(公众号名称)是

list 子命令

参数说明必须
--fakeid公众号的 FakeID(从 search 获取)是
--begin偏移量,默认 0否
--count获取数量,默认 10,最大 100否
--keyword在该公众号内搜索关键词否

read 子命令

参数说明必须
--url微信文章链接是
--format输出格式:text(默认)或 html否

凭证设置

当用户说「设置公众号凭证」「绑定公众号」「公众号凭证」时,调用 status 子命令。如果未绑定或已过期,tool 会自动输出绑定链接,引导用户扫码完成授权。微信公众号凭证通过 OAuth 扫码授权设置,不支持手动填写。

典型对话流程

  1. 用户:搜索公众号 游戏葡萄 → 调 search,返回 fakeid
  2. 用户:获取最新文章 → 调 list,返回文章列表(含标题、链接)
  3. 用户:帮我看看第一篇 → 调 read,返回全文内容供总结

安全约束

  1. 仅读取公开发布的文章,不涉及私密信息
  2. 凭证存储在用户个人 workspace,互不影响
  3. 请勿高频请求,避免触发微信风控