Skip to content

Instantly share code, notes, and snippets.

@cameroooon
Created May 29, 2012 03:35
Show Gist options
  • Select an option

  • Save cameroooon/2822375 to your computer and use it in GitHub Desktop.

Select an option

Save cameroooon/2822375 to your computer and use it in GitHub Desktop.
Pull thumbnail data from Flickr using JSON and write them out as a list
function writeFlickrPics() {
var $flickrContainer = $(".flickr ul");
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=52617155@N08&format=json&jsoncallback=?", function(data) {
var listItems = [];
$.each(data.items, function(i, item) {
var sqr = (item.media.m).replace("_m.jpg", "_s.jpg");
listItems.push("<li><a href='" + item.link + "'><img src='" + sqr + "' /></a></li>");
});
$flickrContainer.append(listItems.join(''));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment