" go test -v -cover Usage Example File: package main import ( "log" "os" "github.com/knspriggs/go-twi" /> " go test -v -cover Usage Example File: package main import ( "log" "os" "github.com/knspriggs/go-twi" /> " go test -v -cover Usage Example File: package main import ( "log" "os" "github.com/knspriggs/go-twi"/>

A golang client for the Twitch v3 API - public APIs only (for now)

Overview

Build Status

go-twitch

Test

CLIENT_ID="<my client ID>" go test -v -cover

Usage

Example File:

package main

import (
  "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="<my 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

Issues
  • update Accept header

    update Accept header

    Pr by this https://github.com/knspriggs/go-twitch/issues/32

    opened by dimensi 7
  • GetStreamByChannel not work.

    GetStreamByChannel not work.

    Hi! I new in golang. Try use your library.

    	twitchSession, err := twitch.NewSession(twitch.NewSessionInput{ClientID: "eaaygbr09v6tn9j5ser40hgqrj7cli"})
    
    	if err != nil {
    		log.Fatalln(err)
    	}
    
    	stream := twitch.GetStreamByChannelInputType{Channel: "90810861"}
    
    	resp, err := twitchSession.GetStreamByChannel(&stream)
    
    	if err != nil {
    		log.Fatalln(err)
    	}
    
    	log.Printf("Resp: \n%#v", resp)
    

    I got empty struct GetStreamByChannelOutputType. image links[1] have right url for check stream. If i use this url in postman i got right response. image

    opened by dimensi 5
  • A set of superficial improvements

    A set of superficial improvements

    • The root URL is now an URL object rather than string
    • Test are in their own package
    • The DefaultURL is only within the test package

    TODO:

    • I was thinking that it'd be good to rejig the tests to perhaps use Goblin or some other framework that makes pre-steps (like creating a session) more simply done.
    • I was also thinking of renaming some of the structs add remove the work "Type" from the suffix.
    shipit 
    opened by AlexThurston 4
  • Missing License?

    Missing License?

    Hi. Without a proper license, no one else can legally use this library. See https://help.github.com/articles/open-source-licensing/ for details. Perhaps Apache 2.0, or MIT?

    opened by tedyoung 2
  • Fix formatting

    Fix formatting

    opened by knspriggs 1
  • Add license

    Add license

    closes #30

    opened by knspriggs 1
  • Add missing channel type docs

    Add missing channel type docs

    opened by knspriggs 1
  • Fix coverall integration

    Fix coverall integration

    opened by knspriggs 1
  • Add preview struct

    Add preview struct

    https://github.com/knspriggs/go-twitch/issues/34 by this issue.

    opened by dimensi 1
  • Mock out http calls for tests

    Mock out http calls for tests

    Currently the tests require an actual auth token to make calls to the real twitch API endpoint. This is bad because outside contributors can't submit PRs that pass unit tests as a result of Travis CIs secret parameter functionality.

    bug 
    opened by knspriggs 0
  • Update accept header pr

    Update accept header pr

    In reference to #33

    @edDimensi

    opened by knspriggs 0
  • Simplify Types

    Simplify Types

    Simplify each of the types and eliminate those that don't make sense.

    opened by knspriggs 0
Releases(v1.0)
Owner
Kristian Spriggs
Kristian Spriggs
📼 Automatic Twitch Recorder

?? rekōdā - Automatic Twitch Recorder Rekōdā, レコダ - means Recorder in Japanese Is a CLI tool inspired by streamlink but with more capabilities. Mainly

イワン 7 Jan 18, 2022
Chat bot for twitch

Microbot Chat bot for twitch. Run You need to provide config and cred files.

null 1 Oct 23, 2021
A pay later service to allow our users to buy goods from a merchant now, and then allow them to pay for those goods at a later date.

simple-pay-later A pay later service to allow our users to buy goods from a merchant now, and then allow them to pay for those goods at a later date.

Ranjith KS 0 Dec 11, 2021
Go API Client for NASA's Open APIs

Go Client for Nasa Open APIs Description The Go Client for Nasa Open APIs is a Go Client for the following Nasa Open APIs: APOD: Astronomy Picture of

Ernesto H 3 Sep 24, 2021
lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin to AWS Lambda and Amazon API Gateway.

aws-lambda-go-api-proxy makes it easy to run Golang APIs written with frameworks such as Gin with AWS Lambda and Amazon API Gateway.

Amazon Web Services - Labs 588 Jan 20, 2022
A site displaying musical groups information by receiving a public API. The server was written in Go.

A site displaying musical groups information by receiving a public API. The API consists of 4 parts with each represent a subset of the information. W

Julia C 0 Dec 13, 2021
The MinIO Admin Go Client SDK provides APIs to manage MinIO services

Golang Admin Client API Reference The MinIO Admin Golang Client SDK provides APIs to manage MinIO services. This quickstart guide will show you how to

High Performance, Kubernetes Native Object Storage 18 Jan 14, 2022
Clusterpedia-client - clusterpedia-client supports the use of native client-go mode to call the clusterpedia API

clusterpedia-client supports the use of native client-go mode to call the cluste

Calvin Chen 4 Jan 7, 2022
Client-go - Clusterpedia-client supports the use of native client-go mode to call the clusterpedia API

clusterpedia-client supports the use of native client-go mode to call the cluste

clusterpedia.io 4 Jan 11, 2022
Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs

PnPjs is a fluent JavaScript API for consuming SharePoint and Microsoft Graph REST APIs in a type-safe way. You can use it with SharePoint Framework,

Microsoft 365 Community 544 Jan 14, 2022
Simple-api - Create Simple `Hello World` APIs from Various Programming Languages

simple-api Create Simple `Hello World` APIs from Various Programming Languages.

I am Groot 1 Jan 18, 2022
rpCheckup is an AWS resource policy security checkup tool that identifies public, external account access, intra-org account access, and private resources.

rpCheckup - Catch AWS resource policy backdoors like Endgame rpCheckup is an AWS resource policy security checkup tool that identifies public, externa

Gold Fig Labs Inc. 139 Dec 23, 2021
Alibaba Cloud jarvis-public SDK for Go

English | 简体中文 Alibaba Cloud jarvis-public SDK for Go Requirements It's necessary for you to make sure your system have installed Go environment which

null 0 Jan 19, 2022
Twilight is an unofficial Golang SDK for Twilio APIs

Twilight is an unofficial Golang SDK for Twilio APIs. Twilight was born as a result of my inability to spell Twilio correctly. I searched for a Twillio Golang client library and couldn’t find any, I decided to build one. Halfway through building this, I realized I had spelled Twilio as Twillio when searching for a client library on Github.

Ghvst Code 18 Jul 2, 2021
A Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

Kinesumer is a Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

당근마켓 54 Dec 21, 2021
Go library to access geocoding and reverse geocoding APIs

GeoService in Go Code Coverage A geocoding service developed in Go's way, idiomatic and elegant, not just in golang. This product is designed to open

Jerry Zhao 423 Jan 6, 2022
Auto-generated Google APIs for Go.

Google APIs Client Library for Go Getting Started $ go get google.golang.org/api/tasks/v1 $ go get google.golang.org/api/moderator/v1 $ go get google.

Google APIs 2.9k Jan 17, 2022
Sync your bank transactions with google sheets using Open Banking APIs

Sync your bank transactions with google sheets using Open Banking APIs

Alex Russell-Saw 27 Oct 2, 2021
Sync your bank transactions with google sheets using Open Banking APIs

this is a markdown version of the copy on the site landing page: https://youneedaspreadsheet.com You need a spreadsheet ?? Get on top of your finances

Alex Russell-Saw 27 Oct 2, 2021