Last active
August 29, 2015 14:01
-
-
Save jleclanche/f79a0cb59ea835b9a790 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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