示例#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])
	}

}
示例#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)
}
示例#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)
	}

}
示例#4
0
文件: online.go 项目: Ambrevar/Demlo
func init() {
	musicBrainzClient, _ = gomusicbrainz.NewWS2Client("https://musicbrainz.org/ws/2", application, version, URL)
}