Skip to content

Instantly share code, notes, and snippets.

@zetok
Forked from stengland/bbcradio.sh
Last active December 27, 2015 20:09
Show Gist options
  • Save zetok/7382965 to your computer and use it in GitHub Desktop.
Save zetok/7382965 to your computer and use it in GitHub Desktop.
#!/bin/bash
play() {
playlist="http://www.bbc.co.uk/radio/listen/live/r"$1"_aaclca.pls"
if mpc
then
curl -s $playlist | grep File1 | sed 's/File1=\(.*\)/\1/' | xargs mpc add
mpc play
else
mplayer_args="-cache 5120 -cache-min 1 -playlist $playlist"
mplayer $mplayer_args || mplayer2 $mplayer_args
fi
}
if [ -z "$1" ]; then
echo "Select a station:"
select s in 1 2 3 4 "5 Live 5l" 6 1x 4x "5 Live sports extra 5lsp" "Asian Network an"
do
play ${s##* }
break
done
else
play $1
fi
# GistID: 4052479
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment