Go library for accessing the Twitch-API.
This is still a work in progress.
Check the progress here.
To install go-twitch
run the command:
$ go get github.com/mrshankly/go-twitch/twitch
Here's an example program that gets the top 10 twitch games:
package main
import (
"fmt"
"github.com/mrshankly/go-twitch/twitch"
"log"
"net/http"
)
func main() {
client := twitch.NewClient(&http.Client{})
opt := &twitch.ListOptions{
Limit: 10,
Offset: 0,
}
games, err := client.Games.Top(opt)
if err != nil {
log.Fatal(err)
}
for i, s := range games.Top {
fmt.Printf("%d - %s (%d)\n", i+1, s.Game.Name, s.Viewers)
}
}
TODO
All files under this repository fall under the MIT License (see the file LICENSE).