Getting started
Sections
Help

Flickr

From Snowfire Wiki

Jump to: navigation, search

Add flickr photos to your website with the following javascript (works inside templates and containers)

<div id="flickrBadge"></div>
<script type="text/javascript">
	$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=49887732@N07&lang=en-us&format=json&jsoncallback=?", function(data) {
		for (i = 0; i < 8; i++) {
			item = data.items[i];
			var baseimg = item.media.m;
			var thumbimg = baseimg.replace("_m.jpg", "_s.jpg");
			var lgeimg = baseimg.replace("_m.jpg", "_b.jpg");   
 
			$("<img />")
				.attr("src", thumbimg)
				.appendTo("#flickrBadge")
				.wrap("<a href='" + item.link + "'></a>");
		}
	});
</script>

What to change

  • Change 49887732@N07 to your flickr id . (use this tool to convert your username to an id: http://idgettr.com/)
  • Inside you have three different variables (baseimg, thumbimg and lgeimg) representing three different image sizes. I'm using the smallest one.


This example is also available in In the social video tutorial

Views
Personal tools