Member Sign In
Not a member?

A Wired.com user account lets you create, edit and comment on Webmonkey articles. You will also be able to contribute to the Wired How-To Wiki and comment on news stories at Wired.com.


It's fast and free.

Webmonkey is a property of Wired Digital.
processing...
Join Webmonkey

Please send me occasional e-mail updates about new features and special offers from Wired/Webmonkey.
Yes No

Please send occasional e-mail offers from Wired/Webmonkey affiliated web sites and publications, and carefully selected companies.
Yes No

I understand and agree that registration on or use of this site constitutes agreement to Webmonkey's User Agreement and Privacy Policy.
Webmonkey is a property of Wired Digital.
processing...

Retrieve Sign In

Please enter your e-mail address or username below. Your username and password will be sent to the e-mail address you provided us.

or
Webmonkey is a property of Wired Digital.
processing...

Welcome to Webmonkey

A private profile page has been created for you.
As a member of Webmonkey, you can now:
  • edit articles
  • add to the code library
  • design and write a tutorial
  • comment on any Webmonkey article
Close
Webmonkey is a property of Wired Digital.

Sign In Information Sent

An e-mail has been sent to the e-mail address registered in this account.
If you cannot find it in your in-box, please check your bulk or junk folders.
Sign In
Webmonkey is a property of Wired Digital.

Build a thumbnail page using delicious and flickr

/skill level/
/viewed/
0 Times

Contents

Introduction

An example on how to use the power of flickr and del.icio.us (and some funky javascript) to build an easily configurable thumbnail page on your website.

The idea is to tag a picture of flickr on del.icio.us and show it magicallyon your web page.

What you'll need

You will need an account on http://flickr.com and one on http://del.icio.us.com (both free!)

Steps

Just visualize some image on flickr, go to the size you want to see in your page and tag it on del.icio.us with a "special tag": I use in the sample: WFTM+pictures .

Use this code to retrieve the items:


<script type="text/javascript" src="http://del.icio.us/feeds/json/maborg/WFTM+pictures?count=20"></script>

then add this element to your page:

		
<div class="container">
	<span id="pictures-display"></span>
</div>
</code>

And then this code (to be called at the onload):

<script type="text/javascript">
function myload(){
	
	var ct = document.getElementById('pictures-display');
	for (var index in Delicious.posts) {
			var k=Delicious.posts[index];
			var span = document.createElement('span');
			var a = document.createElement('a');
			var img = document.createElement('img');
			img.setAttribute('src', k.u);
			img.setAttribute('title', k.d);
			img.setAttribute('alt', k.d);
			
			a.setAttribute('href', bigPictureUrl(k.u) );
			a.appendChild(img);
			
			span.appendChild(a);
			span.appendChild(document.createTextNode(" "));
			ct.appendChild(span);
	}
}

function bigPictureUrl(url){
	
	var parts = url.split("/",5);
	var splits = parts[4].split("_");
	return  "http://www.flickr.com/photo_zoom.gne?id=" + splits[0] + "&size=l";

}
</script>

That's all!

suggestion welcome: marco.borgna@weshowthemoney.com

You can see an example here: http://weshowthemoney.com/pictures.html

USE THE CLOUD!

Alternate methods

Suggested readings

  • This page was last modified 08:09, 20 May 2008.
Edit this article
Reddit Digg
 
Subscribe now

Special Offer For Webmonkey Users

WIRED magazine:
The first word on how technology is changing our world.

Subscribe for just $10 a year