Search code examples
cssjsonapiflickr

Json and Flickr API


I've gone through the http://css-tricks.com/examples/BuildYourSocialPage/ which is great, but I just want to customise the amount of Flickr images it pulls in(6) with the API.

I know I could set a div with overflow:hidden to show the desired amount, but I don't want the code to be hacky.

Can anyone help?

Also I'd like to display my last.fm latest albums, does anyone know where you can get the API to do this?

Thanks

Paul

P.S I know you can get premade plugins and do all this through wordpress, but I don't want to do that. It's just a small expirmental page to test ideas.


Solution

    1. The Flickr Feeds Service do not allow such parameterization, but you could change the JavaScript code that displays them to filter only the first 6

      $.each(data.items, function(index, item){
              if (index < 6){
                $("<img/>").attr("src", item.media.m).appendTo("#flickr")
                .wrap("<a href='" + item.link + "'></a>");}
            });
      
    2. Last.fm Api => user.getWeeklyAlbumChart