/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//jquery galeria flickr $(document).ready( function() { var Cont = $('<ul>').appendTo('.fotos'); var ifo = { Api : 'YOUR API ID', //flickr api Set : '72157612297020622', //foto set fLink : 'http://www.flickr.com/photos/burgersux/', //link da galeria no flickr Cant : 2 //qtd de fotos a serem exibidas }; $.getJSON('http://api.flickr.com/services/rest/?format=json&jsoncallback=?&api_key='+ifo.Api+'&method=flickr.photosets.getPhotos&photoset_id='+ifo.Set+'&per_page='+ifo.Cant, function(Data){ if (Data.stat == "ok"){ for (var i=0; i<Data.photoset.photo.length; i++){ var photo = Data.photoset.photo[i]; var Thum = 'http://farm'+photo['farm']+'.static.flickr.com/'+photo['server']+'/'+photo['id']+'_'+photo['secret']+'_'+'s.jpg'; Cont.append('<li><a href="'+ifo.fLink+photo['id']+'/in/set-'+ifo.Set+'" title="'+photo['title']+'"><img src="'+Thum+'" alt="'+photo['title']+'" /></a></li>'); }; } }); });