Blogger :
Ajaxian Blog
All posts :
All posts by Ajaxian Blog
Category :
WS, web services
Blogged date : 2008 Jul 29
Have you ever wanted to be able to easily grab a thumbnail image that represents a website?
Eric Ferraiuolo has created Ajax-Alexa-Thumbnails on Google Code, a library that builds on YUI to do just that.
The project consists of a server-side component written in PHP which makes the cross-domain request to Amazon's Alexa Site Thumbnail web service, and a JavaScript component which makes Ajax requests to configured server-side component and caches the results.
How do you call it?
JAVASCRIPT:
-
-
(function(){
-
YAHOO.util.Event.onDOMReady(function(){
-
var container = YAHOO.util.Dom.get("container");
-
-
YAHOO.EDF.Thumbnail.init({
-
source: "alexa_service.php",
-
size: "large",
-
anchor: true
-
});
-
-
YAHOO.EDF.Thumbnail.getThumbnail("http://code.google.com/p/ajax-alexa-thumbnails/", function(thumbnail){
-
container.appendChild(thumbnail);
-
}).getThumbnail("http://developer.yahoo.com/yui/", function(thumbnail){
-
container.appendChild(thumbnail);
-
});
-
});
-
}());
-
Since this uses Alexa, it can't give you a snapshot of any page out there.
