From 998cd10ac2a0148052e03471d019aafdd2e14f8c Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 11 Apr 2009 15:31:16 +0200 Subject: New script: Add shared stations by homepage url --- contrib/addshared.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 contrib/addshared.sh (limited to 'contrib') 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` " + exit 1 +fi + +curl -s "$1" | sed -nre "s#.*launchStationFromId\('([0-9]+)'\).*#j\1#gp" > "$ctl" + +exit 0 + -- cgit v1.2.3