From c4d0e3de7ad04114797abb14368e4a6f8da04a60 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 8 May 2026 23:55:30 +0200 Subject: Updates from alpine --- scripts/old/sfeed-browser | 80 ----------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100755 scripts/old/sfeed-browser (limited to 'scripts/old/sfeed-browser') diff --git a/scripts/old/sfeed-browser b/scripts/old/sfeed-browser deleted file mode 100755 index 774c808..0000000 --- a/scripts/old/sfeed-browser +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh - -# This script is based on sfeed (https://codemadness.org/sfeed.html), but -# it allows you organize your feeds in directories and subdirectories. -# In your $sfd directory (see below) you should have two folders: -# urls: it can contain more subfolders and files. Each file should contain -# only one line with the url to the feed. The name of the file is the -# name of the feed (it can contains spaces and such). -# files: this one can be empty, it will be filled with the feed files -# An older version of this script also marked viewed items and removed -# them before displaying the choice of feeds. Contact me if you are interested -# in using it. - -# Requires: sfeed, dmenu-file-picker (or similar), open-url (or similar) - -# Usage: sfeed-browser [-m menu] - -filepicker="dmenu-filepicker" # Try "nnn -p -" -menu="dmenu -l 35 -i" -urlopener=open-url -sfd="$HOME/box/sfeed" -showlast=10 - -usage() { - echo "sfeed-browser [-m MENU]" -} - -while getopts "m:" opt; do - case "$opt" in - m) - menu="$OPTARG" - ;; - *) - usage - exit 1 - ;; - esac -done - -# Might add more stuff later -fixurl() { - sed 's/old\.reddit\.com/reddit\.com/' -} - -dirtofeedpaths() { - while read -r line; do - find "$line" | while read -r fname; do - [ -f "$fname" ] && echo "$fname" - done - done -} - -pathstosfeedrc() { - printf 'sfeedpath="%s"\n\nfeeds() {\n' "$sfd/files" - while read -r line; do - feedname=$(echo "$line" | sed 's/.*\///') - read -r feedurl <"$line" - printf '\tfeed "%s" "%s"\n' "$feedname" "$feedurl" - done - printf "}\n" -} - -feedmenu() { - while read -r line; do - feedname=$(echo "$line" | sed 's/.*\///') - sfeed_plain "$sfd/files/$feedname" | head -$showlast - done | $menu -} - -openfeeds() { - while read -r line; do - url=$(echo "$line" | sed 's/.*[\t ]//' | fixurl) - [ -n "$url" ] && echo "$url" - done | xargs $urlopener -} - -$filepicker "$@" "$sfd/urls" | dirtofeedpaths > "$sfd/last" -pathstosfeedrc < "$sfd/last" > "$sfd/sfeedrc" -sfeed_update "$sfd/sfeedrc" -feedmenu < "$sfd/last" | openfeeds -- cgit v1.3