"早上7点整,我还在做梦。但我的Agent已经读完了34个RSS源,筛选出12篇有价值的文章,生成了摘要,发送到了飞书群。当我醒来打开手机,看到的不是999+的未读消息,而是一份精心整理的晨报。这就是RSS自动化给我的礼物——时间。"
世界上有一种痛苦叫"信息过载"。当你的订阅源超过10个,每天产生的未读文章超过50篇,阅读就变成了一种负担。而OpenClaw的RSS自动化方案,让Agent成为你的专属编辑——自动抓取、智能筛选、生成摘要、定时推送。你只需要看精华。
📡 什么是RSS自动化?
RSS(Really Simple Syndication)是一种内容分发协议,让网站可以发布更新的摘要。通过RSS自动化,你可以:
- 自动抓取多个RSS源的最新内容
- AI智能筛选和分类文章
- 生成文章摘要和要点
- 定时推送到指定渠道
- 构建个人知识库
🛠️ RSS订阅源推荐
| 类别 | 推荐源 | 更新频率 |
|---|---|---|
| AI研究 | OpenAI Blog, Anthropic Blog, DeepMind | 每周 |
| 技术社区 | Hacker News, Dev.to, Hashnode | 每日 |
| 产品动态 | Product Hunt, TechCrunch | 每日 |
| 开源项目 | GitHub Trending, GitHub Blog | 每日 |
| 行业洞察 | MIT Tech Review, The Gradient | 每周 |
💡 实战实现
1. RSS抓取和解析
使用web_fetch获取RSS内容
// RSS源列表
const RSS_SOURCES = [
{ name: "OpenAI", url: "https://openai.com/blog/rss.xml" },
{ name: "Anthropic", url: "https://www.anthropic.com/rss.xml" },
{ name: "Hugging Face", url: "https://huggingface.co/blog/feed.xml" }
];
async function fetchRSS(url) {
try {
const xml = await web_fetch({
url: url,
extractMode: "text"
});
return parseRSS(xml);
} catch (error) {
console.error(`获取RSS失败: ${url}`, error);
return [];
}
}
// 简单的RSS解析(实际可用专用库)
function parseRSS(xml) {
const items = [];
const itemRegex = /- [\s\S]*?<\/item>/g;
const items_match = xml.match(itemRegex);
if (items_match) {
for (const item of items_match.slice(0, 5)) {
const title = item.match(/
(.*?)<\/title>/)?.[1] || "";
const link = item.match(/(.*?)<\/link>/)?.[1] || "";
const pubDate = item.match(/(.*?)<\/pubDate>/)?.[1] || "";
const description = item.match(/(.*?)<\/description>/)?.[1] || "";
items.push({ title, link, pubDate, description });
}
}
return items;
}
2. 内容筛选和摘要
AI智能处理RSS内容
async function processRSSItems(items, keywords) {
const processed = [];
for (const item of items) {
// 关键词匹配
const matches = keywords.some(kw =>
item.title.toLowerCase().includes(kw.toLowerCase()) ||
item.description.toLowerCase().includes(kw.toLowerCase())
);
if (matches) {
// 获取全文
const fullContent = await web_fetch({
url: item.link,
extractMode: "text",
maxChars: 3000
});
// AI生成摘要
const summary = await generateSummary(fullContent);
processed.push({
...item,
summary,
relevance: calculateRelevance(item, keywords)
});
}
}
// 按相关度排序
return processed.sort((a, b) => b.relevance - a.relevance);
}
// 生成摘要(使用Agent)
async function generateSummary(content) {
// 这里会调用Agent生成摘要
return `摘要: ${content.slice(0, 200)}...`;
}
3. 定时聚合任务
设置定时RSS聚合
cron({
name: "每日RSS聚合",
schedule: {
kind: "cron",
expr: "0 7 * * *", // 每天早上7点
tz: "Asia/Shanghai"
},
payload: {
kind: "agentTurn",
message: `执行RSS聚合任务:
1. 从配置的RSS源抓取最新文章
2. 筛选与AI、OpenClaw相关的文章
3. 生成每篇文章的摘要
4. 整理成HTML格式
5. 保存到 /var/www/miaoquai/rss/
6. 发送通知到飞书群
`
}
})
4. 生成RSS聚合页面
自动生成分类RSS页面
async function generateRSSPage(articles, date) {
const html = `
AI资讯聚合 - ${date}
📰 ${date} AI资讯精选
今日共筛选出 ${articles.length} 篇高质量文章
${articles.map(article => `
${article.title}
${article.summary}
阅读全文 →
`).join('')}
`;
// 保存文件
writeFile(`/var/www/miaoquai/rss/aggregate-${date}.html`, html);
}
🔄 高级功能
智能分类
按主题自动分类
const CATEGORIES = {
"技术研究": ["research", "paper", "study", "architecture"],
"产品动态": ["launch", "release", "update", "feature"],
"行业新闻": ["news", "industry", "market", "trend"],
"教程指南": ["tutorial", "guide", "how-to", "getting started"]
};
function categorizeArticle(article) {
const text = (article.title + " " + article.description).toLowerCase();
for (const [category, keywords] of Object.entries(CATEGORIES)) {
if (keywords.some(kw => text.includes(kw))) {
return category;
}
}
return "其他";
}
去重机制
避免重复推送
// 已推送文章记录
const PROCESSED_URLS = new Set();
function isNewArticle(article) {
if (PROCESSED_URLS.has(article.link)) {
return false;
}
PROCESSED_URLS.add(article.link);
return true;
}
// 定期清理旧记录(保留30天)
function cleanupOldRecords() {
// 实现清理逻辑
}
RSS优化建议
• 选择高质量的RSS源,宁缺毋滥• 设置合理的抓取频率,避免给源站造成压力
• 使用关键词过滤,减少无关内容
• 定期清理失效的RSS源
• 保留原始链接,尊重内容出处
注意事项:
• 遵守RSS源的robots.txt和使用条款
• 不要过频繁地抓取,建议间隔至少1小时
• 摘要生成需要引用原文,注意版权问题
• 部分RSS源可能需要验证或API Key
• 遵守RSS源的robots.txt和使用条款
• 不要过频繁地抓取,建议间隔至少1小时
• 摘要生成需要引用原文,注意版权问题
• 部分RSS源可能需要验证或API Key