dotfiles

personal dotfiles
git clone anongit@rnpnr.xyz:dotfiles.git
Log | Files | Refs | Feed | Submodules

Commit: 9de71dab1c04e4f9ba741b3600e08378a644c2a8
Parent: fb13c77b4adcd97b2fad03e4a0520be723396c5e
Author: Randy Palamar
Date:   Sun, 14 May 2023 07:59:21 -0600

bin/rssup: simplify; update crontab

sfeed_unread can be used to get a count of new entries which can then
be displayed in the statusbar. no need for html and other nonsense

Diffstat:
M.config/cron/crontab | 2+-
Mbin/rssup | 31++++++-------------------------
2 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/.config/cron/crontab b/.config/cron/crontab @@ -1,2 +1,2 @@ # Update RSS -0 */5 * * * ~/bin/rssup blogs soft videos 2>&1 >/dev/null +0 */2 * * * ~/bin/rssup blogs soft videos 2>&1 >/dev/null; pkill -RTMIN+3 status diff --git a/bin/rssup b/bin/rssup @@ -1,38 +1,19 @@ #!/bin/sh # updates rss feeds with sfeed -# sends a notification when a new entry is found - -[ ${#} -lt 1 ] && ( - echo 'Wrong number of arguments' - exit 1 -) configdir=~/.config/sfeed -tmp=$(mktemp) -trap '[ -f "$tmp" ] && rm $tmp' EXIT HUP INT - -update() { - sfeed_update $configdir/${1}.sh - wait - html ${1} -} - -html() { - sfeed_html $sfeedpath/* >| $tmp - compare ${1} +usage() +{ + echo "usage: $(basename $0) feedname [...]" + exit 1 } -compare() { - cmp -s $tmp $configdir/html/${1}.html || ( - mv $tmp $configdir/html/${1}.html && - notify -c "browser $configdir/html/${1}.html" 'New RSS Entries: '"${1}" - ) -} +[ ${#} -lt 1 ] && usage for arg; do . $configdir/${arg}.sh [ -d "$sfeedpath" ] || mkdir -p "$sfeedpath" - update $arg + sfeed_update $configdir/${arg}.sh done