Galbum for Picasaweb

back

Google's Picasa Web Albums has a API, which includes some easy JSON feeds.

You can combine it pretty easily with the one of the decent javascript viewers online, like Lightbox (based on prototype/scriptaculous.)

GAlbum is my wrapper that you can use to put web galleries on your site. It's now got a reasonably bulletproof API, and you can put multiple galleries on the same page (so it's useful for Wordpress blogs and the like). And if Google makes big changes to image URLs, I'll try to keep things updated.

Anyway, once you get the includes set up, all you do to include a whole gallery on your site is something like this:

<script type="text/javascript">
	// lorna's 2007 TED gallery: username, album name, authkey
	loadFromGoogle("herfstudios", "5170859194730407921", "Kf9YUjycXu4");
</script>

You can find an albumID by clicking on the "RSS" button when viewing an album. If you're showing a public album, the third parameter (authkey) is not needed.

Try it out (view source for more).

You can get the combined lightbox with galbum here: all.js or get just galbum.js instead.

Note if you go the a la carte route (including galbum.js directly), the only change to Lightbox is that initLightbox() is patched to be lazy like this:

function initLightbox() { 
	if (typeof(myLightbox) == "undefined") {
		myLightbox = new Lightbox(); 
	}
}

That's about it.

blog comments powered by Disqus