This repository has been archived by the owner on Jan 23, 2019. It is now read-only.
getTopTracks
jamesfleeting edited this page Jun 8, 2011
·
2 revisions
- name
- duration
- mbid
- playcount
- link
- streamable
- artist.name
- artist.mbid
- artist.link
- image.small
- image.medium
- image.large
- image.extralarge
$.simpleLastFM({
apikey: 'XXXXXXXXXXXXXXXX', //Get it at http://www.last.fm/api/account
username: 'YOURUSERNAME',
method: 'getTopTracks',
limit: 7, //Max is 200
period: 'overall',
success: function(results) {
html = '<h2>Top Tracks</h2>';
$(results).each(function() {
html += '<strong>Track</strong>: '+this.name+' (mbid: '+this.mbid+')<br />';
html += '<strong>Duration</strong>: '+this.duration+'<br />';
html += '<strong>Playcount</strong>: '+this.playcount+'<br />';
html += '<strong>Link</strong>: <a href="'+this.link+'">'+this.link+'</a><br />';
html += '<strong>Streamable</strong>: '+this.streamable+'<br />';
html += '<strong>Artist</strong>: '+this.artist.name+' (mbid: '+this.artist.mbid+')<br />';
html += '<strong>Artist Link</strong>: '+this.artist.link+'<br />';
html += '<strong>Images</strong>:<br />';
html += '<img src="'+this.image.extralarge+'"> <img src="'+this.image.large+'"> <img src="'+this.image.medium+'"> <img src="'+this.image.small+'"></p>';
});
$("#topTracks").html(html);
},
error: function(error) {
$("#topTracks").html('<p>'+error+'</p>');
}
});