WeChat RSS Skill
Fetch and display the latest articles from WeChat public accounts using the wcrss.com API.
Prerequisites
Before using this skill, the user must:
- 1. Register an account at https://wcrss.com/
- Add favorite public accounts at https://wcrss.com/publishers
- Generate an API key at https://wcrss.com/settings
- Save the API key as an environment variable INLINECODE0
Python Scripts
This skill uses Python scripts for data fetching:
- - Location:
scripts/wechat_rss.py (relative to skill directory) - Commands:
-
python scripts/wechat_rss.py fetch <recentDays> <num> - Fetch articles (auto-cached for 1 hour)
-
python scripts/wechat_rss.py get <index> - Get single article by index
-
python scripts/wechat_rss.py count - Get total articles count
Workflow for Agent
Step 1: Fetch Articles List
Execute the Python script to fetch articles:
CODEBLOCK0
Step 2: Get Total Articles Count
CODEBLOCK1
Step 3: Process Each Article
For each article index from 0 to (count-1), call:
CODEBLOCK2
This returns:
CODEBLOCK3
Step 4: Summarize Each Article
For each article, use the LLM to summarize the content_html into key points (bullet list).
LLM Prompt:
CODEBLOCK4
Step 5: Display Results
For each article, display in this format:
CODEBLOCK5
Error Handling
- - If "WCRSSAPIKEY environment variable not set" error occurs, guide the user to configure the API key
- If API returns an error, display the error message to the user
- If no articles are found, inform the user and suggest checking their followed publishers
微信RSS技能
使用wcrss.com API获取并展示微信公众号的最新文章。
前置条件
使用此技能前,用户必须:
- 1. 在 https://wcrss.com/ 注册账号
- 在 https://wcrss.com/publishers 添加关注的公众号
- 在 https://wcrss.com/settings 生成API密钥
- 将API密钥保存为环境变量 WCRSSAPIKEY
Python脚本
本技能使用Python脚本进行数据获取:
- - 位置: scripts/wechat_rss.py(相对于技能目录)
- 命令:
- python scripts/wechat_rss.py fetch
- 获取文章(自动缓存1小时)
- python scripts/wechat_rss.py get - 按索引获取单篇文章
- python scripts/wechat_rss.py count - 获取文章总数
代理工作流程
步骤1:获取文章列表
执行Python脚本获取文章:
bash
python scripts/wechat_rss.py fetch 3 10
步骤2:获取文章总数
bash
python scripts/wechat_rss.py count
步骤3:处理每篇文章
对于从0到(总数-1)的每个文章索引,调用:
bash
python scripts/wechat_rss.py get
返回内容:
json
{
title: 文章标题,
author: 公众号名称,
content_html:
HTML内容...
,
url: https://example.com/s/article,
publish_time: %Y-%m-%d %H:%M,
description: 文章简介
}
步骤4:总结每篇文章
对每篇文章,使用LLM将content_html总结为关键要点(项目列表)。
LLM提示词:
请从以下文章内容中提取关键要点,以条目的形式列出:
标题:{title}
作者:{author}
内容:{content_html}
时间:{publish_time}
请提取3-8个核心要点,每个要点用一句话概括。
步骤5:展示结果
每篇文章按以下格式展示:
【{序号}】{标题}
作者:{公众号名称} {时间}
文章要点:
原文链接:{url}
错误处理
- - 如果出现WCRSSAPIKEY environment variable not set错误,引导用户配置API密钥
- 如果API返回错误,向用户显示错误信息
- 如果未找到文章,告知用户并建议检查其关注的公众号