Forked from: https://github.com/dkorunic/gomdb with some updates.
4319c85503
- Extend QueryData to be able to use s and i queries with Season and Episode parameters - Exnted MovieByImdbID() to include Season and Episode where appropriate, - Refactor MovieByImdbID() to use QueryData as per standard API which also permits SearchType, Season and Episode filters - Update unit tests for API changes |
||
---|---|---|
.gitignore | ||
.travis.yml | ||
gomdb.go | ||
gomdb_test.go | ||
LICENSE | ||
README.md |
The Golang Omdb API
Author: Christopher T. Herrera (eefretsoul AT gmail DOT com)
This API uses the omdbapi.com API by Brian Fritz
OMDBAPI.com
This is an excellent open database for movie and film content.
I strongly encourage you to check it out and contribute to keep it growing.
http://www.omdbapi.com
Project Usage
The API usage is very simple.
package main
import (
"fmt"
"github.com/eefret/gomdb"
)
func main() {
api := gomdb.Init(YOUR_API_KEY)
query := &gomdb.QueryData{Title: "Macbeth", SearchType: gomdb.MovieSearch}
res, err := api.Search(query)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(res.Search)
query = &gomdb.QueryData{Title: "Macbeth", Year: "2015"}
res2, err := api.MovieByTitle(query)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(res2)
res3, err := api.MovieByImdbID("tt2884018")
if err != nil {
fmt.Println(err)
return
}
fmt.Println(res3)
}
See the project documentation to see the Response Objects and stuff