Return to Snippet

Revision: 13463
at April 24, 2009 11:08 by danielfilho


Updated Code
//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>');
			};
		}
	});
});

Revision: 13462
at April 24, 2009 11:03 by danielfilho


Initial Code
//jquery galeria flickr
$(document).ready( function() {
	var Cont = $('<ul>').appendTo('.fotos');
	var ifo = {
		Api : '18d7111cbd9b559de4b64a21ad8342d7', //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>');
			};
		}
	});
});

Initial URL

                                

Initial Description

                                

Initial Title
Flickr set gallery

Initial Tags
javascript, jquery

Initial Language
JavaScript