Skip to content

iaping/opentrivia

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opentrivia

This repository contains an API client for Open Trivia DB.

opentrivia was developed under golang version 1.8 and not tested on previous versions of the language.

Usage

opentrivia (godoc)

go get github.com/pinheirolucas/opentrivia

Construct a new Open Trivia API client, then use the services on the client to access different parts of the API. For example:

client := opentrivia.DefaultClient

// list 10 random questions
questions, err := client.Question.List(nil)

Some API methods have optional parameters that can be passed. For example:

client := opentrivia.DefaultClient

// list 20 questions with difficulty easy
options := &opentrivia.QuestionListOptions{
	Difficulty: opentrivia.QuestionDifficultyEasy,
	Limit: 20,
}
questions, err := client.Question.List(options)

License

This library is distributed under the MIT license found in the LICENSE file.

About

API client for Open Trivia DB: https://opentdb.com/

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 100.0%