This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
go-discogs/examples/discogs_example.go

30 lines
511 B
Go
Raw Normal View History

2016-03-04 16:08:02 +00:00
package main
import (
"fmt"
2017-02-13 16:40:27 +00:00
2016-03-04 16:48:26 +00:00
"github.com/irlndts/go-discogs"
2016-03-04 16:08:02 +00:00
)
func main() {
2017-02-14 19:01:50 +00:00
d := discogs.NewClient("TestDiscogsClient/0.0.1 +http://irlndts.moscow", "")
2016-03-10 14:25:55 +00:00
2017-04-25 16:39:32 +00:00
request := &discogs.SearchRequest{Q: "The Swindlers - Dig Out Alive!", Page: 0, Per_page: 1}
2017-02-14 19:01:50 +00:00
search, _, err := d.Search.Search(request)
2016-03-10 14:25:55 +00:00
2016-03-09 15:14:42 +00:00
if err != nil {
fmt.Println(err)
2017-02-13 16:40:27 +00:00
return
}
for _, r := range search.Results {
2017-04-25 16:39:32 +00:00
fmt.Printf("%+v\n", r)
//fmt.Println(r.Id, r.Title)
release, _ := d.Release(r.ID)
fmt.Printf("%+v\n", release)
2016-03-09 15:14:42 +00:00
}
2017-04-25 16:39:32 +00:00
2016-03-04 16:08:02 +00:00
}