{"item":{"id":"wf-rss-digest","product":"openclaw","language":"zh","title":"构建可重复执行、保留来源的 RSS 汇总","summary":"可运行的 Node 样例抓取订阅、按网址去重并记住已读条目。真实输入得到 35 条独立记录，原样重放没有新增；Agent 定时接入尚未测试。","contentType":"experience","category":"workflow","revision":2,"canonicalUrl":"https://botclaw.tech/items/wf-rss-digest?lang=zh","sourceUrls":["https://botclaw.tech/examples/rss-digest.mjs","https://botclaw.tech/evidence/rss-digest.json","https://docs.openclaw.ai/automation/cron-jobs"],"sourcePublishedAt":"2026-10-01T13:51:23.773Z","reviewedAt":"2026-10-01T00:00:00.000Z","collectedAt":"2026-10-01T13:51:23.773Z","updatedAt":"2026-10-01T13:51:29.241Z","source":{"id":"botclaw-editorial","name":"BotClaw","origin":"editorial"},"summaryMethod":"editor","applicability":{"version":"Node.js 24.15.0 (RSS example only)","platforms":["Node.js 24+","Windows / macOS / Linux"],"requirements":["Node.js 24+、npm 和公开 HTTPS 订阅源","可写本地目录，无需账户凭据或模型密钥"]},"verification":{"kind":"software_execution","checkedAt":"2026-10-01T12:48:16.317Z","urls":["https://botclaw.tech/examples/rss-digest.mjs","https://botclaw.tech/evidence/rss-digest.json","https://docs.openclaw.ai/automation/cron-jobs"],"limitations":["仅运行了可下载的 Node 样例，未执行 Agent 接入、定时运行和模型解读。"]},"body":{"introduction":"先把采集做成确定的步骤，再让 Agent 解读资讯。样例输出短摘录、原始链接、每个来源的状态和独立已读 ID 文件，不生成日报，也不补写缺失内容。","sections":[{"heading":"准备输入","paragraphs":["将样例下载到空目录，把 feeds.json 放在旁边。最多接受十个公开 HTTPS 订阅源，拒绝包含凭据的网址。发布摘录前核对来源的使用范围。"],"code":"npm install fast-xml-parser@5.11.1\n# feeds.json\n{\"feeds\":[\"https://botclaw.tech/feed.xml?lang=en\",\"https://botclaw.tech/feed.xml?product=hermes&lang=en\"]}\n# Run after saving the JSON file\nnode rss-digest.mjs feeds.json digest.json digest-state.json"},{"heading":"执行和检查","paragraphs":[],"steps":["打开 digest.json，核对 stats.unique 与条目数。每条必须有标题、HTTPS 链接和来源；缺少发布日期时保留 null。","使用同一状态文件再次运行。未变化的网址应计入 previouslySeen，不再进入 items。试用另一组来源前备份状态。","接入 Agent 时先让它读取现有 JSON 并引用链接。检查工作目录、输出位置和重复执行后，再设置一次定时运行。"]},{"heading":"成功判据","paragraphs":["已记录的 Windows / Node 24.15.0 运行抓取两个订阅源：40 条输入合并为 35 个独立网址，原样重放没有新条目。证据文件包含脚本哈希。这验证了 Node 采集链路，未验证 OpenClaw 或 Hermes 接入。"]},{"heading":"失败处理与限制","paragraphs":["进程成功时也要检查 sources[].state，避免一个成功来源掩盖另一个失败来源。全部失败时非零退出并保留旧状态。拒绝非法 XML 和超大响应。去重依据网址，不识别文章修订，只保留最近 2,000 个 ID。订阅核对时间不代表原文内容最新。"]}]},"indexable":true,"supersededBy":null,"review":{"state":"current","pendingChanges":0,"policyDays":7}}}