diff --git a/Makefile b/Makefile index 23a80de..458d811 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ man: sh: mkdir -p $(DESTDIR)$(PREFIX)/bin cp -f sh/paste $(DESTDIR)$(PREFIX)/bin - cp -f sh/trss-yt-id $(DESTDIR)$(PREFIX)/bin + cp -f sh/ $(DESTDIR)$(PREFIX)/bin cp -f sh/disp $(DESTDIR)$(PREFIX)/bin cp -f sh/wallpaper $(DESTDIR)$(PREFIX)/bin cp -f sh/connect $(DESTDIR)$(PREFIX)/bin diff --git a/sh/sfeed_yt_add b/sh/sfeed_yt_add new file mode 100755 index 0000000..43c8a95 --- /dev/null +++ b/sh/sfeed_yt_add @@ -0,0 +1,25 @@ +#!/bin/sh + +[ -z "$1" ] && exit 1 +[ -z "$2" ] && exit 1 + +printf "[info] this utility is used for adding youtube urls as rss feeds\n" + +feed="$(curl ${1} -s | \ + grep 'youtube/www\.youtube\.com/channel/.\{24\}' -o | \ + awk -F'/' '{print "https://www.youtube.com/feeds/videos.xml?channel_id=" $NF}' | \ + sed 1q)" + +[ -z "$feed" ] && printf "[err] error processing the feed. are you sure it's *www*.youtube.com and not youtube.com?\n" && exit 1 + +tmp="$(mktemp)" + +sfeedrc="$HOME/.config/sfeed/sfeedrc" + +ed "$sfeedrc" <