voidrice/.local/bin/rssadd
2020-04-04 12:45:33 -07:00

10 lines
349 B
Bash
Executable file

#!/bin/sh
! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null &&
notify-send "That doesn't look like a full URL." && exit
RSSFILE="$XDG_CONFIG_HOME/newsboat/urls"
if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then
notify-send "You already have this RSS feed."
else
echo "$1" >> "$RSSFILE" && notify-send "RSS feed added."
fi