I am trying to customize this script so that my favorite artists are displayed instead of the last custom tracks.
This is what I came up with, however it does not work. I thought it would be easy to change the attributes of the feed, but obviously not ...
(function($){ $.fn.lastFM = function(options) { var defaults = { number: 10, username: 'willblackmore', apikey: '96e0589327a3f120074f74dbc8ec6443', artSize: 'medium', noart: 'images/noartwork.gif', onComplete: function(){} }, settings = $.extend({}, defaults, options); var lastUrl = 'http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user='+settings.username+'&api_key='+settings.apikey+'+'&limit='+settings.number+'&format=json&callback=?'; var $this = $(this); var container = $this.html(); $this.children(':first').remove(); if(settings.artSize == 'small'){imgSize = 0} if(settings.artSize == 'medium'){imgSize = 1} if(settings.artSize == 'large'){imgSize = 2} this.each(function() { $.getJSON(lastUrl, function(data){ $.each(data.topartists.artist, function(i, item){ if(item.image[1]['
Any ideas? Thanks.
Sean McRaghty
source share