Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dimensi/go-twitch
A golang client for the Twitch v3 API - public APIs only (for now)
https://github.com/dimensi/go-twitch
Last synced: 14 days ago
JSON representation
A golang client for the Twitch v3 API - public APIs only (for now)
- Host: GitHub
- URL: https://github.com/dimensi/go-twitch
- Owner: dimensi
- License: mit
- Created: 2017-08-20T19:22:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-20T20:40:22.000Z (over 7 years ago)
- Last Synced: 2024-10-24T09:43:25.515Z (2 months ago)
- Language: Go
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.com/knspriggs/go-twitch.svg?token=zZCoL2DxeY3FuDqHfbp7&branch=add-travisci-yaml)](https://travis-ci.com/knspriggs/go-twitch)
# go-twitch
### Test
```
CLIENT_ID="" go test -v -cover
```### Usage
Example File:
```go
package mainimport (
"log"
"os""github.com/knspriggs/go-twitch"
)var clientID string
func init() {
clientID = os.Getenv("CLIENT_ID")
}func main() {
twitchSession, err := twitch.NewSession(twitch.NewSessionInput{ClientID: clientID})
if err != nil {
log.Fatalln(err)
}searchChannelsInput := twitch.SearchChannelsInputType{
Query: "knspriggs", // see https://github.com/justintv/Twitch-API/blob/master/v3_resources/search.md for query syntax
Limit: 2, // optional
Offset: 0, // optional
}resp, err := twitchSession.SearchChannels(&searchChannelsInput)
if err != nil {
log.Fatalln(err)
}
log.Printf("Resp: \n%#v", resp)
}
``````
CLIENT_ID="" go run example/main.go
```To get a client ID see the documentation from the Twitch API https://github.com/justintv/Twitch-API/blob/master/authentication.md