David Whiting
Music Tech Fest Hack Camp - 18th May 2011
Get information about the artist "Demoscene Time Machine":
To do this:
artist.getinfo({
artist: "Demoscene Time Machine",
api_key: "202ece1f999e55ce1c3aaabbbad6ae40",
format: "json"})
We need to hit this URI:
http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Demoscene+Time+Machine&api_key=202ece1f999e55ce1c3aaabbbad6ae40&format=json
Get the current hyped track chart:
http://ws.audioscrobbler.com/2.0/?method=chart.gethypedtracks&api_key=202ece1f999e55ce1c3aaabbbad6ae40&format=json
Get the current top "electro house" artists:
http://ws.audioscrobbler.com/2.0/?method=tag.getweeklyartistchart&tag=electro+house&api_key=202ece1f999e55ce1c3aaabbbad6ae40&format=json
$.get(
"http://ws.audioscrobbler.com/2.0/?",
{
method: "chart.gethypedtracks",
api_key: "202ece1f999e55ce1c3aaabbbad6ae40",
format: "json"
},
function(response) {
// do something useful with response here
}
});
tag:"indie folk" will play you tracks which have been tagged "indie folk"simart:"Depeche Mode" will play you tracks by artists similar to Depeche Modeuser:DavW will play music from my libraryneigh:DavW will play music from the libraries of users with similar taste to metag:rock not tag:pop will play tracks tagged "rock" which aren't tagged "pop"tag:ambient or tag:metal will play tracks tagged "ambient" or "metal"simart:"Joy Division" and tag:"post punk" will play post-punk tracks similar to Joy Divisiontag:electro opt:bpm|120:140 - electro music between 120bpm and 140bpmtag:rock opt:mainstr|0.2 - play less mainstream rock music (mainstr is 'mainstreamness' from 0 to 1)Base64 encode it, then insert in the URL "lastfm://rql/{base64encodedRQL}"
If you have a Last.fm client installed, opening this link will play your radio station
This URL is also a valid input to the radio.tune() API method (if you want to write your own client)
var q2 = new lfmc_TopFeed('track')
.setSize(5)
.onData(function(list) {
//present list data here
});