go-twitch-helix

module
v0.0.0-...-cbb24c1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: MIT

README

go-twitch-helix

travis-ci status Coverage Status GoDoc

Go library for accessing the new Twitch-API.

Additional api calls are available for some Twitch v5 Api, to fill in the gaps until the new Api is complete.

Usage

To install go-twitch-helix run the command:

$ go get github.com/Julusian/go-twitch-helix

Full docs at GoDocs

Here's an example program that gets the top 10 twitch games:

package main

import (
	"fmt"
	"log"
	"net/http"
	"os"

	"github.com/Julusian/go-twitch-helix/helix"
	"github.com/Julusian/go-twitch-helix/twitch"
)

func main() {
	client := twitch.NewApiClient(&http.Client{}, os.Getenv("CLIENT_ID"))

	opts := &helix.StreamsParams{
		Limit: 10,
	}

	res, rate, err := helix.GetStreams(client, opts)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Rate limiter %d/%d remaining", rate.Remaining, rate.Limit)

	for i, s := range res.Data {
		fmt.Printf("%d - %s (%d)\n", i+1, s.Title, s.ID)
	}
}
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