rss-watch is a command-line utillity for watching RSS/Atom feeds and executing a script whenever there's a new entry on the given feed.
Data about the entry is passed as environment variables to the script.
rss-watch creates a SQLite database to keep track of previously seen feeds and
entries.
If you don't override the database path using the -d flag, the following
default location will be used, depending on your platform.
| Platform | Path |
|---|---|
| *nix | $XDG_DATA_HOME/rss-watch/database.db |
| MacOS | $HOME/Library/Application Support/rss-watch/database.db |
| Windows | %LOCALAPPDATA%\mkroman\rss-watch\database.db |
You may want to run rss-watch with --import-only the first time you're
watching a new feed, as this will import the current feed entries without
running the scripts.
rss-watch --import-only https://blog.rust-lang.org/feed.xml
Then, to watch and refresh a feed every 6 hours and execute ./some-script.sh
for each new entry, run:
rss-watch -r 6h https://blog.rust-lang.org/feed.xml ./some-script.sh
Create the file publish-redis-message.sh with the following contents:
#!/usr/bin/env bash
redis-cli publish some.channel "There's a new commit: ${FEED_LINK}"Make it executable:
chmod +x ./publish-redis-message.sh
And run rss-watch with
rss-watch -r 1m https://github.com/mkroman/rss-watch/commits/master.atom ./publish-redis-message.sh
And it'll now check for new commits once a minute and publish the commit url to
the channel some.channel.
This is a list of the environment variables that can be passed to the script.
| Name | Description |
|---|---|
| FEED_URL | The URL to the whole feed. Required |
| FEED_GUID | The unique ID for the given entry. This is used to distinguish the entry from old ones. Required |
| FEED_LINK | Link to the "full story" for this entry. On an Atom entry this will be the first "alternate" link. Optional |
| FEED_TITLE | The title of the new entry. Optional |
Prerequisites:
- libsqlite3-dev
rss-watch is currently only available from crates.io or GitHub.
cargo install rss-watch
cargo install --git https://github.com/mkroman/rss-watch.git rss-watch
This software is licensed under the BSD 2-clause License.