Created
May 29, 2011 10:28
-
-
Save ayush/997633 to your computer and use it in GitHub Desktop.
Sample usage of musix-lib library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// instantiate the API | |
val api = new MusixMatch("YOUR_API_KEY") | |
// get artist lady gaga | |
val artists = api.findExactArtistsByName("lady gaga") | |
assert(artists.length > 0) | |
for (artist <- artists) { | |
println(artist) | |
} | |
// Get all albums of Tori Amos | |
val albums = api.getArtistAlbums("46") | |
assert(albums.length > 0) | |
println("Got " + albums.length + " albums") | |
for (album <- albums) { | |
println(album) | |
} | |
// Get lyrics for track Faith by George Michael | |
val lyrics = api.getLyrics("745388") | |
assert(lyrics != null && lyrics.body.length() > 0) | |
println(lyrics.body) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment