More information about the Underscore mailing list

[_] Flickr API/Slideshow recommendations

Keir Moffatt hello at iamkeir.com
Thu Jul 1 16:45:39 BST 2010

On Thu, Jul 1, 2010 at 4:32 PM, Nick Clarkson <nick_clarkson at hotmail.com>wrote:

> No problem - let me know if you get stuck. ..
>

I managed to get what I need from very little code indeed - so I'm concerned
I'm missing something! Here's what worked for me:

var feed = '
http://api.flickr.com/services/feeds/photoset.gne?set=72157624049432441&nsid=50439421@N08&lang=en-us&format=json&jsoncallback=?
';
$.getJSON(feed, function(data) {
  $.each(data.items, function(i, item) {
    var imgSquare = (item.media.m).replace("_m.jpg",  "_s.jpg");
    var imgSmall = item.media.m
    $('<img/>').attr('src', imgSquare, 'alt',
item.title).appendTo('#images')
    .wrap('<a href="' + imgSmall + '" title="View ' + item.title + ' on
Flickr"></a>');
  });
});

Is there anything there that screams of incorrect?!

Thanks again,

Keir
-- 
http://iamkeir.com