Skip to content

Instantly share code, notes, and snippets.

@jleclanche
Last active August 29, 2015 14:01
Show Gist options
  • Save jleclanche/f79a0cb59ea835b9a790 to your computer and use it in GitHub Desktop.
Save jleclanche/f79a0cb59ea835b9a790 to your computer and use it in GitHub Desktop.
function twitch {
if [[ $1 == "--check" ]]; then
streams=("day9tv" "totalbiscuit" "trumpsc" "noxious_hs")
for s in $streams; do
offline=$(curl --silent "https://api.twitch.tv/kraken/streams/$s/" | grep '"stream":null')
if [[ $offline == "" ]]; then
echo "$s is online"
fi
done
return
fi
stream=${2:-source}
livestreamer --player=mpv "https://www.twitch.tv/$1" $stream
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment