2020-02-08 18:43:37 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-03-12 21:20:17 -04:00
|
|
|
! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null &&
|
2019-03-20 14:45:08 -04:00
|
|
|
notify-send "That doesn't look like a full URL." && exit
|
2020-04-08 17:21:40 -04:00
|
|
|
RSSFILE="${XDG_CONFIG_HOME:$HOME/.config}/newsboat/urls"
|
2019-03-12 21:20:17 -04:00
|
|
|
if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then
|
2019-03-20 14:45:08 -04:00
|
|
|
notify-send "You already have this RSS feed."
|
2019-03-12 21:20:17 -04:00
|
|
|
else
|
2019-03-20 14:45:08 -04:00
|
|
|
echo "$1" >> "$RSSFILE" && notify-send "RSS feed added."
|
2019-03-12 21:20:17 -04:00
|
|
|
fi
|