summaryrefslogtreecommitdiffstats
path: root/.local/bin/rssadd
blob: 924ee5254401569bd4309c9fa7382ea1176a99e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/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:$HOME/.config}/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