A Rust CLI that polls RSS/Atom feeds and posts new entries to an XMPP MUC (Multi-User Chat) room. Designed to run periodically via cron.
Build
cargo build --release
Configuration
Copy config.example.toml to config.toml and fill in your credentials (in the working directory, next to the binary, or pass via --config <path>):
[xmpp]
jid = "bot@example.org"
password = "secret"
muc = "room@conference.example.org"
nick = "feedbot"
cache_file = "seen_alerts.db" # optional, defaults to "seen_alerts.db"
cache_ttl_secs = 86400 # optional, dedup window in seconds, defaults to 86400 (24h)
[[feeds]]
name = "Alerts"
url = "https://example.org/feed.xml"
format = "atom" # or "rss" / "noaa-rss"
# Optional: route a specific feed to a different room (defaults to xmpp.muc)
[[feeds]]
name = "Weather"
url = "https://example.org/weather.rss"
format = "rss"
muc = "weather@conference.example.org"
Usage
./feed2xmppbot # poll feeds and post new entries
./feed2xmppbot --test # send a test message to the MUC
./feed2xmppbot --version # print the binary version and exit
./feed2xmppbot --config /path/to/config.toml
Add to cron to poll periodically, e.g. every 5 minutes:
*/5 * * * * /path/to/feed2xmppbot
How It Works
- Fetches each configured feed via HTTP
- Parses XML and extracts entries/items
- Deduplicates against the cache file (append-only)
- For each new entry, opens a fresh XMPP connection, joins the MUC, posts the message, and disconnects
Requirements
- Rust 1.87+ (uses edition 2024 let-chains syntax)
- TLS uses native-tls (system OpenSSL)