Created
May 29, 2012 03:35
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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