Update README
This commit is contained in:
parent
44efcabb06
commit
783cdb77f5
1 changed files with 33 additions and 8 deletions
41
README.md
41
README.md
|
@ -17,17 +17,42 @@ I *strongly* encourage you to check it out and contribute to keep it growing.
|
||||||
***
|
***
|
||||||
Project Usage
|
Project Usage
|
||||||
-------------
|
-------------
|
||||||
The API usage is very simple. Just import the go-imdb package
|
The API usage is very simple.
|
||||||
|
|
||||||
import (
|
```go
|
||||||
imdb "github.com/eefret/go-imdb"
|
package main
|
||||||
)
|
|
||||||
|
|
||||||
And use any of the methods
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/efret/gomdb"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
query := &gomdb.QueryData{Title: "Macbeth", SearchType: gomdb.MovieSearch}
|
||||||
|
res, err := gomdb.Search(query)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println(res.Search)
|
||||||
|
|
||||||
|
query = &gomdb.QueryData{Title: "Macbeth", Year: "2015"}
|
||||||
|
res2, err := gomdb.MovieByTitle(query)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println(res2)
|
||||||
|
|
||||||
|
res3, err := gomdb.MovieByImdbID("tt2884018")
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println(res3)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
res, err := imdb.Search("The fifth element", "")
|
|
||||||
res2, err := imdb.MovieByTitle("True Grit", "1969")
|
|
||||||
res3, err := imdb.MovieByImdbID("tt2015381")
|
|
||||||
|
|
||||||
See the project documentation to see the Response Objects and stuff
|
See the project documentation to see the Response Objects and stuff
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue