Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
fetch flickr photos in javascript & put them on a page.
<!-- fetch flickr photos in javascript & put them on a page. Based on Jon LeBlanc's PHP code: http://developer.yahoo.net/blog/archives/2010/04/building_flickr_urls_from_yql_flickrphotossearch_results.html -->
<body>
<script>
function cbfunc(obj){
for(var i = 0; i < obj.query.results.photo.length; i++){
var farm = obj.query.results.photo[i].farm;
var server = obj.query.results.photo[i].server;
var id = obj.query.results.photo[i].id;
var secret = obj.query.results.photo[i].secret;
var img = new Image();
img.src = 'http://farm'+farm+'.static.flickr.com/'+server+'/'+id+'_'+secret+'.jpg';
document.body.appendChild(img);
}
}
</script>
<script src='http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20flickr.photos.search%20where%20has_geo%3D%22true%22%20and%20text%3D%22ucsd%22%20and%20safe_search%3D%22true%22&format=json&diagnostics=false&callback=cbfunc'></script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.