From 1959be7ffd2bff816a769ff4b3327e87e4da0992 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sun, 18 Jun 2023 15:24:41 -0400 Subject: [PATCH] contrib/mrss.sh: made changes - mrss select is no longer here (rip), no reason to support it - you can now make meta-feeds by making folders of directory symlinks - jq: sub -> gsub --- contrib/mrss.sh | 102 ++++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 65 deletions(-) diff --git a/contrib/mrss.sh b/contrib/mrss.sh index 8b71fcd..ffdda79 100755 --- a/contrib/mrss.sh +++ b/contrib/mrss.sh @@ -23,13 +23,12 @@ sub_help() { echo echo "commands:" echo " update updates feeds" - echo " select show each new article and prompt for an action;" - echo " you can run 'select new/feed' for a specific feed" - echo " or 'select watch-later'." echo " fzf show articles using fzf" echo " use the commands /read (enter), /purge (ctrl-d), /purge-all (ctrl-alt-d)," echo " /watch-later (ctrl-w) and /queue (ctrl-e)" - echo " you can also run 'fzf feed' for a specific feed." + echo " you can also 'fzf feed' for a specific feed," + echo " or 'fzf new/feed' for new articles in the feed," + echo " or 'fzf watch-later' for articles marked watch-later." echo " 'fzf -s' shuffles the feed." echo echo "article commands (pass files as arguments):" @@ -77,7 +76,7 @@ list_purge() { sub_purge() { if [ -z "$@" ]; then cd "$MRSS_DIR"/new - find . -type l -or -type f | list_purge + find . -type f | list_purge else for art in "$@"; do printf "%s\n" "$art" @@ -186,64 +185,6 @@ sub_watchlater() { done | list_watchlater } -sub_select() { - if [ -z "$1" ]; then - DIR="$MRSS_NEWDIR" - else - DIR="$MRSS_DIR/$1" - fi - NEWARTS="$(find "$DIR" -type l -or -type f)" - TOTAL_COUNT="$(printf "%s" "$NEWARTS" | wc -l)" - printf "%s" "$NEWARTS" | ( - - INDEX=0 - while read -r ARTICLE; do - if [ -n "$SKIPALL" ]; then - continue - fi - - INDEX=$((INDEX+1)) - clear - printf "\nItem %s/%s\n" "$INDEX" "$TOTAL_COUNT" - sub_preview "$ARTICLE" - - printf "\n\n-----------------\n" - printf "\nq quit, r read, e queue article, f full summary, d purge (mark read),\n" - printf "s skip, S skip all, w watch later\n" - - while true; do - printf "\n> " - read ans "$INDXFILE" cat "$INDXFILE" | sed "s/^[0-9]*: //" \ | xargs -rd "\n" cat \ - | jq -r '[.feedname?, .title] | map(select(. != null)) | join(" - ") | sub("\n"; " ")' \ + | jq -r '[.feedname?, .title] | map(select(. != null)) | join(" - ") | gsub("\n"; " ")' \ | nl -ba -d'' -n'rz' -s': ' -w1 \ > "$LISTFILE"