summaryrefslogtreecommitdiff
path: root/contrib/addshared.sh
blob: 246cd989b5c9fd5ada8f334274cb2b107f33831b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# extract shared station id from station homepage and add it to pianobar

ctl="$HOME/.config/pianobar/ctl"

if [ -z "$1" ]; then
	echo "Usage: `basename $0` <station url>"
	exit 1
fi

curl -s "$1" | sed -nre "s#.*launchStationFromId\('([0-9]+)'\).*#j\1#gp" > "$ctl"

exit 0