go-twitch

module
v0.0.0-...-8f5e0ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2017 License: MIT

README

go-twitch

travis-ci status

Go library for accessing the Twitch-API.

This is still a work in progress.

Check the progress here.

Usage

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)
	}
}
Authentication

TODO

License

All files under this repository fall under the MIT License (see the file LICENSE).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL