Skip to content

Instantly share code, notes, and snippets.

Created September 19, 2013 00:08
Show Gist options
  • Save anonymous/6617520 to your computer and use it in GitHub Desktop.
Save anonymous/6617520 to your computer and use it in GitHub Desktop.
#gallery img { float: left; max-width: 50px; max-height: 50px; }
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div id="gallery"></div>
</body>
</html>
var flickr = {
getFeed: function(userID, tagList, callback) {
var baseURL = "http://api.flickr.com/services/feeds/photos_public.gne?format=json&jsoncallback=flickr.callback";
var tagParam = tagList.join(",");
var url = baseURL + "&id="+userID+"&tags="+tagParam;
console.log("Getting: ",url);
this.callback = callback;
$.ajax(url,
{
type: "GET",
dataType: "jsonp"
});
}
};
$(function() {
flickr.getFeed("55503365@N04", ['hdr','canon60d'], function (data) {
for(var i in data.items) {
var item = data.items[i];
var src = item.media.m;
$('#gallery').append('<img src="'+src+'" />');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment