Creating Flickr Slideshow Using Google AJAX Feed API
Posted on 31st August 2008 by joeI want to intergrate Flickr image into my Rss News aggregator site and I found out that I can use Google AJAX Feed API. Since google already provide the documentation and example for the API code I think it is my job to tweak it for Malayapark.com.
Code snippet
<html>
<head>
<script type=”text/javascript” src=”http://www.google.com/jsapi?key=”YOUR-KEY”></script>
<script type=”text/javascript”>google.load(”feeds”, “1″);
var defaultUser = ‘wazari’;
function newSlideShow(user) {
showStatus(’Resolving feed for ‘ + user);
var url = ‘http://www.flickr.com/photos/’ + user;
google.feeds.lookupFeed(url, lookupDone);
}function lookupDone(result) {
if (result.error || result.url == null) {
showStatus(’Could not locate feed for user’);
return;
}showStatus(’Found Photo Feed’);
// We need to switch over from Atom to RSS to get Yahoo Media for slideshow..
var url = result.url.replace(’format=atom’, ‘format=rss_200′);
showSlideShow(url);
}function showSlideShow(url) {
var options = {
displayTime: 2500,
transistionTime: 800,
scaleImages: true,
thumbnailTag: ‘content’,
linkTarget : google.feeds.LINK_TARGET_BLANK
};
new GFslideShow(url, “slideshow”, options);
}google.setOnLoadCallback(function() {newSlideShow(defaultUser)});
</script>
</head><body>
<div id=”feedControl”>Loading</div>
</body>
</html>
Descriptions
this is the most important part - Google API Key. Each key is unique for a website.
<script type=”text/javascript” src=”http://www.google.com/jsapi?key=”YOUR-KEY”></script>
displayTime: 2500 - Time to display the images in milisecond
transistionTime: 800 - Transition time in milisecond
var defaultUser = ‘wazari’ - Your Usename
Demo 1 : Flickr Slideshow (Credit To wazari)
Demo 2 : Flickr Slideshow (Credit To wazari)
Download : FlickrUserSlideshow
Popularity: 14% [?]
How can we use tags to access pics??


