Home Tutorials Categories Skills About
ZH EN JA KO
Skills-Plugins

Building an RSS Subscription and News Push Skill for OpenClaw

· 16 min read

Introduction

In an age of information overload, RSS remains one of the most efficient ways to stay informed. By building an RSS subscription Skill, you can have OpenClaw automatically monitor your favorite sources, generate summaries, and push them to your chat channels.

This tutorial walks through the complete implementation of an RSS subscription and news push Skill, with support for multi-source aggregation, AI summaries, scheduled delivery, and OPML import.

Feature Overview

Feature Description
Add Subscription Add a feed source via RSS/Atom URL
OPML Import Batch import existing RSS subscriptions
Scheduled Fetching Automatically check for new content at set intervals
AI Summaries Automatically generate article summaries
Channel Push Deliver new content to designated chat channels
Manage Subscriptions View, delete, and categorize feed sources

Preparation

Configure MCP Tools

Add the required MCP tools in ~/.config/openclaw/openclaw.json5:

{
  mcp: {
    servers: {
      "http-fetch": {
        command: "npx",
        args: ["-y", "@openclaw-mcp/http-fetch"]
      },
      "filesystem": {
        command: "npx",
        args: ["-y", "@modelcontextprotocol/server-filesystem",
               "--allow-read", "--allow-write",
               "~/.openclaw/data/rss/"]
      },
      "scheduler": {
        command: "npx",
        args: ["-y", "@openclaw-mcp/scheduler"]
      }
    }
  }
}

Create the data directory:

mkdir -p ~/.openclaw/data/rss/

Writing the SKILL.md

Create ~/.openclaw/skills/rss-reader.SKILL.md:

---
name: rss-reader
version: 1.0.0
description: RSS/Atom 订阅监控和新闻推送技能
triggers:
  - rss
  - 订阅
  - subscribe
  - 新闻
  - news
  - 资讯
  - feed
mcp_tools:
  - http_fetch
  - filesystem
  - scheduler
---

# RSS 订阅和新闻推送技能

## Description

监控 RSS/Atom 订阅源,自动抓取新内容,生成 AI 摘要,
并推送到用户所在的聊天频道。

## Commands

用户可以通过以下命令与 RSS 技能交互:

### 添加订阅
- "订阅 {URL}" - 添加一个 RSS 订阅源
- "订阅 {URL} 分类到 {分类名}" - 添加并归类

### 管理订阅
- "我的订阅" / "订阅列表" - 查看所有订阅
- "取消订阅 {名称或编号}" - 删除订阅
- "暂停订阅 {名称或编号}" - 暂停更新检查
- "恢复订阅 {名称或编号}" - 恢复更新检查

### 查看内容
- "最新资讯" / "今天的新闻" - 查看最新未读内容
- "查看 {订阅名} 的更新" - 查看特定源的更新

### OPML 操作
- "导入OPML {URL或内容}" - 批量导入订阅
- "导出OPML" - 导出当前所有订阅

### 推送设置
- "设置推送时间 {时间}" - 设定每日推送时间
- "关闭推送" / "开启推送" - 切换推送状态

## Behavior

### 添加订阅流程

1. 用户提供 RSS/Atom URL
2. 使用 http_fetch 获取 feed 内容
3. 解析 feed,提取标题、描述等元信息
4. 保存到 ~/.openclaw/data/rss/feeds.json
5. 确认订阅成功,显示源名称和最近文章数

### 定时抓取流程

1. 每 30 分钟(默认,可配置)检查所有活跃订阅
2. 使用 http_fetch 获取 feed 最新内容
3. 与已存储的文章对比,找出新增文章
4. 对新文章生成 AI 摘要(50-100字)
5. 存储新文章到 articles.json
6. 如果开启了推送,发送到用户频道

### OPML 导入流程

1. 解析 OPML XML 内容
2. 提取所有 feed URL 和分类信息
3. 逐个验证 feed 可访问性
4. 批量添加到 feeds.json
5. 报告导入结果(成功数、失败数)

## Data Schema

### feeds.json

```json
{
  "feeds": [
    {
      "id": "feed_001",
      "url": "https://example.com/rss.xml",
      "title": "Example Blog",
      "description": "A great blog about tech",
      "category": "技术",
      "status": "active",
      "pollInterval": 1800,
      "lastChecked": "2026-03-28T10:00:00+08:00",
      "lastUpdated": "2026-03-28T09:30:00+08:00",
      "addedAt": "2026-03-25T14:00:00+08:00",
      "channelType": "telegram",
      "channelId": "12345678"
    }
  ]
}

articles.json

{
  "articles": [
    {
      "id": "art_20260328_001",
      "feedId": "feed_001",
      "title": "Article Title",
      "url": "https://example.com/post/123",
      "publishedAt": "2026-03-28T08:00:00Z",
      "summary": "AI生成的文章摘要...",
      "isRead": false,
      "isPushed": false
    }
  ]
}

Output Format

Subscription Added Successfully

✅ 订阅成功!

📰 名称:{源名称}
🔗 地址:{URL}
📁 分类:{分类}
📊 当前文章数:{N} 篇

最近 3 篇文章:
1. {标题1} ({日期1})
2. {标题2} ({日期2})
3. {标题3} ({日期3})

Subscription List

📋 你的 RSS 订阅(共 {N} 个)

技术:
  1. ✅ Example Blog (最后更新: 2小时前) [feed_001]
  2. ✅ Tech News (最后更新: 30分钟前) [feed_002]

设计:
  3. ⏸️ Design Weekly (已暂停) [feed_003]

未分类:
  4. ✅ Personal Blog (最后更新: 1天前) [feed_004]

News Push

📬 今日资讯推送 (2026-03-28)

━━━━━━━━━━━━━━━━

📰 Example Blog
▸ {文章标题1}
  {50-100字AI摘要}
  🔗 阅读全文

▸ {文章标题2}
  {50-100字AI摘要}
  🔗 阅读全文

━━━━━━━━━━━━━━━━

📰 Tech News
▸ {文章标题3}
  {50-100字AI摘要}
  🔗 阅读全文

━━━━━━━━━━━━━━━━
共 {N} 条新内容

Push Schedule Configuration

用户可以自定义推送时间:

  • 默认每日推送时间:08:00 和 18:00
  • 支持自定义:任意时间点,多个时间点
  • 使用 scheduler 工具注册定时任务

推送配置存储在 feeds.json 的顶层:

{
  "pushSettings": {
    "enabled": true,
    "times": ["08:00", "18:00"],
    "timezone": "Asia/Shanghai",
    "maxArticlesPerPush": 20,
    "summarize": true
  },
  "feeds": [...]
}

OPML Format Reference

导入时支持标准 OPML 格式:

<?xml version="1.0" encoding="UTF-8"?>
<opml version="2.0">
  <head>
    <title>My Subscriptions</title>
  </head>
  <body>
    <outline text="技术" title="技术">
      <outline type="rss" text="Example Blog"
               xmlUrl="https://example.com/rss.xml"
               htmlUrl="https://example.com"/>
    </outline>
  </body>
</opml>

导出时生成同样格式的 OPML,用户可以导入到其他 RSS 阅读器。

Error Handling

  • URL 无法访问:提示用户检查 URL 是否正确
  • 非 RSS/Atom 格式:尝试自动发现页面中的 feed 链接
  • 抓取频率限制:尊重 feed 的 TTL 设置和 HTTP Cache 头
  • 存储文件损坏:自动备份并从备份恢复

## Advanced Configuration

### Custom Fetch Intervals

Different types of subscriptions can have different fetch intervals:

```json5
// Add extra configuration for the RSS skill in openclaw.json5
{
  skillConfig: {
    "rss-reader": {
      defaultPollInterval: 1800,   // Default 30 minutes
      minPollInterval: 300,        // Minimum 5 minutes
      maxArticlesStore: 1000,      // Store up to 1000 articles
      summaryMaxLength: 100,       // Maximum summary length in characters
      autoCleanupDays: 30          // Auto-clean articles older than 30 days
    }
  }
}

Content Filtering

You can set keyword filters for a feed source:

订阅 https://example.com/rss.xml 只看包含 AI 或 机器学习 的文章

The skill will record the filter rules in the feed configuration and only keep matching articles during fetching.

Testing Workflow

# Restart to load the skill
openclaw restart

# Confirm the skill is loaded
openclaw skill list

Test scenarios:

  1. Add a well-known RSS feed (such as Hacker News):

    订阅 https://hnrss.org/frontpage
    
  2. View the subscription list:

    我的订阅
    
  3. View latest content:

    最新资讯
    
  4. Test OPML import (using an online OPML file)

  5. Set a push schedule and wait for it to trigger

Recommended RSS Feeds

Here are some high-quality Chinese RSS feeds for testing:

Name URL Category
少数派 https://sspai.com/feed Tech
36氪 https://36kr.com/feed Startups
InfoQ 中文 https://www.infoq.cn/feed Technology
编程随想 Search on your own Technology
Hacker News https://hnrss.org/frontpage Technology

Summary

The RSS subscription Skill turns OpenClaw into an intelligent information aggregator. With AI-generated summaries and scheduled push delivery, you can stay on top of important information without being overwhelmed. This Skill demonstrates how to combine multiple MCP tools (HTTP requests, file storage, scheduled tasks) to build complex functionality.

OpenClaw is a free, open-source personal AI assistant that supports WhatsApp, Telegram, Discord, and many more platforms