summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-04-11 15:31:16 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-04-11 15:31:16 +0200
commit998cd10ac2a0148052e03471d019aafdd2e14f8c (patch)
treef0b7e1bf92020f53da623b7495e2fa71591c09af /contrib
parenteedd4b036bdd5f9d488ff011b7e6947ca1edf312 (diff)
downloadpianobar-998cd10ac2a0148052e03471d019aafdd2e14f8c.tar.gz
pianobar-998cd10ac2a0148052e03471d019aafdd2e14f8c.tar.bz2
pianobar-998cd10ac2a0148052e03471d019aafdd2e14f8c.zip
New script: Add shared stations by homepage url
Diffstat (limited to 'contrib')
-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
+