From 891b01315fba274cebb2dea436c170ac9e6862eb Mon Sep 17 00:00:00 2001 From: x3 Date: Wed, 13 Mar 2024 16:49:25 +0100 Subject: [PATCH] Add readme + little fix --- README.md | 19 +++++++++++++++++++ rss-watch.pl | 1 + 2 files changed, 20 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8684ee1 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# rss-watch.pl + +Perl script to monitor RSS feeds and execute scripts. + +## config + +The config file is stored in `~/.config/rss-watch/config`. Example configuration file: +```cfg +[feed "FeedName"] +url = https://rss.example.com/ +script = /home/user/script_to_exec.sh '$title' '$link' +``` + +This will query the url specified by the `url` key for an RSS feed and execute the given script with the arguments `title` and `link` from the feed. +Multiple script keys can be specified on new lines, which will all be executed. + +Only new entries will be acted on. The file `~/.local/share/rss-watch/latest/{FeedName}` will store the last `guid` value from the feed. + +Use cron, or other tools to run this script periodically. diff --git a/rss-watch.pl b/rss-watch.pl index 1eaadd0..81b63a6 100755 --- a/rss-watch.pl +++ b/rss-watch.pl @@ -225,6 +225,7 @@ sub handle_feed { # This is most likely the first run, do not run all of the backlog # only the items after this one $LATEST{$fname} = $lastid; + save_latest($fname); return 1; } if (defined($LATEST{$fname}) and not $last_hit) {