This repository has been archived by the owner on Jan 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
getRecentTracks
jamesfleeting edited this page Jun 8, 2011
·
4 revisions
- artist.name
- artist.mbid
- name
- link
- album.name
- album.mbid
- image.small
- image.medium
- image.large
- image.extralarge
- streamable
$.simpleLastFM({
apikey: 'XXXXXXXXXXXXXXXX', //Get it at http://www.last.fm/api/account
username: 'YOURUSERNAME',
method: 'getRecentTracks',
limit: 7, //Max is 200
success: function(results) {
html = '<h2>Recent Tracks</h2>';
$(results).each(function() {
html += '<p><strong>Artist</strong>: '+this.artist.name+' (mbid: '+this.artist.mbid+')<br />';
html += '<strong>Track</strong>: '+this.name+'<br />';
html += '<strong>Album</strong>: '+this.album.name+' (mbid: '+this.album.mbid+')<br />';
html += '<strong>Link</strong>: <a href="'+this.link+'">'+this.link+'</a><br />';
html += '<strong>Streamable</strong>: '+this.streamable+'<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>';
});
$("#recentTracks").html(html);
},
error: function(error) {
$("#recentTracks").html('<p>'+error+'</p>');
}
});