Conversation
nanoclaw.yaml にチャンネル別RSSフィード設定を追加し、15分ポーリングで新着記事URLを自動配信する。 - rss-config.ts: nanoclaw.yaml の rss.channels 読み込み - db.ts: rss_seen_items テーブルと既読管理関数を追加 - rss-poller.ts: 15分間隔ポーリング、fast-xml-parser でRSS/Atomパース - index.ts: startRssPoller を main() に統合 - setup-rss スキル: RSS設定手順を追加 - rss.test.ts: 設定読み込み・既読管理・ポーラーのテストを追加
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 848e4291b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| const channel = rss.channel || rss; | ||
| let items: RssItem[] = channel.item || rss.item || []; |
There was a problem hiding this comment.
Parse Atom entries from feed documents
When fetchFeed sees an Atom document (parsed.feed), it still reads only channel.item/rss.item, so Atom <entry> elements are never collected and the poller silently delivers nothing for Atom feeds. This breaks the advertised RSS/Atom support for any channel configured with common Atom sources.
Useful? React with 👍 / 👎.
| markItemSeen(feed.url, entry.guid); | ||
| await deps.sendMessage(channelConfig.jid, text); |
There was a problem hiding this comment.
Mark items seen only after send succeeds
markItemSeen is called before sendMessage, so any transient send failure (API error, timeout, disconnected channel) permanently drops that article: it is recorded as seen and filtered out on all future polls. Move the seen-marker after a successful send (or roll it back on error) to avoid data loss.
Useful? React with 👍 / 👎.
Co-authored-by: Copilot <copilot@github.com>
fix: pollOnce関数で未登録のチャンネルをスキップするロジックを修正 test: getSeenItemIdsのユニットテストを追加
refactor: sortByPubDate関数のコードスタイルを改善し、可読性を向上させた
Summary
nanoclaw.yamlにチャンネル別RSSフィード設定を追加し、15分ポーリングで新着記事URLを自動配信する機能を実装しました。Changes
src/rss-config.ts(新規)nanoclaw.yamlのrss.channelsセクションを読み込むreadRssConfig()— YAMLキャッシュ付き、不正な設定は警告ログでスキップsrc/db.ts(変更)rss_seen_itemsテーブル (feed_url,item_id,seen_at) を追加hasSeenItem()/markItemSeen()アクセサ関数を追加CREATE TABLE IF NOT EXISTS)src/rss-poller.ts(新規)RSS_POLL_INTERVAL = 15 * 60 * 1000) でフィードをポーリングfast-xml-parserでRSS/AtomをパースpubDate昇順に1記事ずつsendMessageを呼ぶlogger.warnでスキップし、他フィードを継続src/index.ts(変更)main()内でstartRssPoller()を起動sendMessageラッパーで未登録チャンネルへの配信を防止.claude/skills/setup-rss/SKILL.md(新規)src/rss.test.ts(新規)Test Results
設定例