This commit integrates River feed aggregation into Vicuna, enabling the bot to:
- Fetch RSS/Atom feeds and post new items to Zulip channels
- Match post authors with registered Vicuna users via smart matching
- Provide both message-based and CLI commands for feed management
- Poll feeds automatically every 5 minutes when enabled
## Key Features
### User Registration Enhancement
- Extended user_registration type with last_river_post_date field
- Backward-compatible serialization/deserialization
- Tracks last posted date per user for deduplication
### River Integration (vicuna_bot.ml)
- Feed source management (add/remove/list feeds)
- Configuration storage (channel, polling status)
- Smart user matching: email exact → name exact → name fuzzy
- Post formatting with markdown conversion and author attribution
- Complete sync-and-post workflow
### Bot Message Commands
All users can use these commands:
- `river feeds` - List configured feeds
- `river add-feed <name> <url>` - Add a feed
- `river remove-feed <name>` - Remove a feed
- `river set-channel <channel>` - Set target Zulip channel
- `river start` - Enable automatic polling
- `river stop` - Disable automatic polling
- `river status` - Show integration status
### CLI Commands
- `vicuna river list` - List configured feeds
- `vicuna river add <name> <url>` - Add a feed
- `vicuna river remove <name>` - Remove a feed
- `vicuna river set-channel <channel>` - Configure target channel
- `vicuna river start` - Enable polling
- `vicuna river stop` - Disable polling
### Automatic Polling
- Background fiber polls feeds every 5 minutes
- Only posts items newer than user's last_river_post_date
- Controlled via --enable-river-polling CLI flag or bot commands
- Graceful error handling with logging
### Post Format
- Topic: Post title
- Body: "By @**User**" (if matched) or "By Author Name"
Summary (200 chars) + [Read more](link)
## Implementation Details
- Uses River library for feed fetching and parsing
- Stores feed config in bot_storage as JSON
- Markdown conversion via River's Markdown_converter
- Jsont-based JSON encoding/decoding
- Fully integrated with existing Vicuna bot infrastructure
## Usage
Start bot with River polling:
```
./vicuna --enable-river-polling
```
Add a feed via CLI:
```
./vicuna river add "OCaml Blog" https://ocaml.org/blog/feed.xml
```
Or via bot message:
```
@vicuna river add-feed "OCaml Blog" https://ocaml.org/blog/feed.xml
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>