Back to Registry
View Author Profile
Official Verified
Wewe Rss Articles
Skill by agasding
skill-install — Terminal
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/agasding/wewe-rss-articlesOr
SKILL.md - 读取微信公众号文章
触发条件
用户要求读取某个公众号的文章列表,或读取某篇文章的正文内容时激活。
前置条件
WeWe RSS 服务必须已部署并运行在 http://localhost:4000。
- 如果服务未运行或未部署 → 调用
wewe-rss-deploySkill 进行部署 - 部署完成后继续执行以下流程
工作流程
Step 1:获取配置路径
读取工作目录下的 tools\wewe-rss-config.txt 获取项目路径:
- 如果文件不存在,使用默认路径:
~/.openclaw/workspace/wewe-rss-main
Step 2:检查服务是否运行
netstat -ano | Select-String ":4000"
- 如果无响应 → 调用
wewe-rss-deploySkill
Step 3:获取公众号 mp_id
方式 A:通过公众号名称查询数据库
数据库路径:{WEWE_RSS_PATH}/apps/server/data/wewe-rss.db
import sqlite3
import os
# 读取项目路径配置
config_path = os.path.expanduser("~/.openclaw/workspace/tools/wewe-rss-config.txt")
if os.path.exists(config_path):
with open(config_path) as f:
wewe_rss_path = f.read().strip()
else:
wewe_rss_path = os.path.expanduser("~/.openclaw/workspace/wewe-rss-main")
db_path = os.path.join(wewe_rss_path, "apps/server/data/wewe-rss.db")
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
# 查找公众号 mp_id
cursor.execute("SELECT mp_id, nickname FROM feeds WHERE nickname LIKE ?", (f'%{公众号名称}%',))
result = cursor.fetchone()
mp_id = result[0] if result else None
方式 B:通过文章链接提取 __biz
从微信文章链接提取 __biz 参数,然后查数据库:
文章链接格式:https://mp.weixin.qq.com/s/xxxxxxxxx
__biz 参数:链接中 ?__biz=MTI0OTk2xxx
# 查询数据库获取 mp_id
cursor.execute("SELECT mp_id FROM feeds WHERE mp_id LIKE ?", (f'%{biz_str}%',))
Step 4:调用 API 获取文章列表
GET http://localhost:4000/feeds/{mp_id}.json?limit=10
请求参数:
| 参数 | 类型 | 说明 |
|---|---|---|
mp_id | string | 公众号 ID,如 MP_WXS_3223096120 |
limit | int | 返回文章数量,默认 10 |
update | bool | 是否强制从微信读书更新 |
响应格式:
[
{
"content": "<article HTML content>",
"url": "https://mp.weixin.qq.com/s/iBCNkORwkff3PL1EZD3zqw",
"title": "文章标题",
"image": "https://mmbiz.qpic.cn/...",
"date_modified": "2026-04-02T02:20:36.000Z"
}
]
curl 示例(跨平台):
curl -s "http://localhost:4000/feeds/${mp_id}.json?limit=5" --max-time 15
Step 5:解析正文内容
content 字段是完整 HTML,提取纯文本:
from html.parser import HTMLParser
class TextExtractor(HTMLParser):
def __init__(self):
super().__init__()
self.text = []
self.skip_tags = {'script', 'style', 'nav', 'footer', 'header', 'aside'}
self.current_tag = None
def handle_starttag(self, tag, attrs):
self.current_tag = tag
if tag in self.skip_tags:
return
if tag == 'p':
self.text.append('\n')
def handle_data(self, data):
if self.current_tag not in self.skip_tags:
text = data.strip()
if text:
self.text.append(text)
def get_text(self):
return '\n'.join(self.text)
# 使用
extractor = TextExtractor()
extractor.feed(html_content)
article_text = extractor.get_text()
数据库信息
Metadata
AI Skill Finder
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skill Add to Configuration
Paste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-agasding-wewe-rss-articles": {
"enabled": true,
"auto_update": true
}
}
}Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.