Skip to content

Instantly share code, notes, and snippets.

@steve-ayerhart
Created December 14, 2015 19:38
Show Gist options
  • Save steve-ayerhart/843af842ca57618d8376 to your computer and use it in GitHub Desktop.
Save steve-ayerhart/843af842ca57618d8376 to your computer and use it in GitHub Desktop.
#!/bin/bash
alias lstrmr=livestreamer-wrapper
alias twitch=twitch-wrapper
livestreamer-wrapper () {
livestreamer $1 best 1>/dev/null &
}
twitch-wrapper () {
livestreamer-wrapper twitch.tv/$1
}
sc2 () {
local sc2_endpoint='https://api.twitch.tv/kraken/streams?game=StarCraft+II&limit=10'
local head='Accept: application/vnd.twitchtv.v3+json'
curl -sH "$head" -X GET "$sc2_endpoint" | jq '.streams[] | .channel | "\(.display_name)~~\(.status)"' | column -ts "~~" | sed 's/^"//' | sed 's/"$//'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment