Example #1
0
func main() {

	// create a new WS2Client.
	client, _ := gomusicbrainz.NewWS2Client(
		"https://musicbrainz.org/ws/2",
		"A GoMusicBrainz example",
		"0.0.1-beta",
		"http://github.com/michiwend/gomusicbrainz")

	// Search for some artist(s)
	resp, _ := client.SearchArtist(`artist:"Parov Stelar"`, -1, -1)

	// Pretty print Name and score of each returned artist.
	for _, artist := range resp.Artists {
		fmt.Printf("Name: %-25sScore: %d\n", artist.Name, resp.Scores[artist])
	}

}
Example #2
0
func main() {

	// create a new WS2Client.
	client, _ := gomusicbrainz.NewWS2Client(
		"https://musicbrainz.org/ws/2",
		"A GoMusicBrainz example",
		"0.0.1-beta",
		"http://github.com/michiwend/gomusicbrainz")

	// Lookup artist by id.
	artist, err := client.LookupArtist("10adbe5e-a2c0-4bf3-8249-2b4cbf6e6ca8")

	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Printf("%+v", artist)
}
Example #3
0
func main() {

	// create a new WS2 client
	client := gomusicbrainz.NewWS2Client()

	// provide some information about your application
	client.SetClientInfo(
		"A GoMusicBrainz example",
		"0.0.1-beta",
		"http://github.com/michiwend/gomusicbrainz")

	// Search for some artist with default settings
	resp, _ := client.SearchArtist(`bonobo OR "Parov Stelar"`, -1, -1)

	// Pretty print Name and Id of each returned artist.
	for _, artist := range resp.Artists {
		fmt.Printf("Name: %-25s ID: %s\n", artist.Name, artist.ID)
	}

}
Example #4
0
func init() {
	musicBrainzClient, _ = gomusicbrainz.NewWS2Client("https://musicbrainz.org/ws/2", application, version, URL)
}