summaryrefslogtreecommitdiff
path: root/contrib/addshared.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/addshared.sh')
-rwxr-xr-xcontrib/addshared.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/addshared.sh b/contrib/addshared.sh
new file mode 100755
index 0000000..246cd98
--- /dev/null
+++ b/contrib/addshared.sh
@@ -0,0 +1,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
+