Tuesday, July 29th, 2008
Ajax-Alexa-Thumbnails: API to get site thumbnails
<>p>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?
- (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.

Related Content:











I really miss the good old days when tasks as simple as that could be coded as:
[img src="/cgi-bin/thumbnail.cgi?url=http%3A//ajaxian.com/&size=64x64"]
Anyone else think that’s a ridiculous amount of code?
I dont even see the point of the thumbnails so that looks like rediculouse code anyways.. And it indeeds looks like it could be a shitload shorter…
Sorry for such a verbose example, but you could code it down to something more like this:
var Thumbnail = YAHOO.EDF.Thumbnail;
Thumbnail.init({ source:”alexa_service.php” });
Thumbnail.getThumbnail(“http://www.google.com”, function(thumb){ //alert(thumb); });
>>Since this uses Alexa, it can’t give you a snapshot of any page out there.
.
Really? None?
.
How about, “Since this uses Alexa, it can’t give you a snapshot of every page out there.”
.
or, “Note that not all pages have Alexa snapshots.”
Nosredna:
On come on, ‘just’ before ‘any’ is obviously implied. Syntactic semantic pedantry generally does not improve language coherency as far as the reader, or even the writer, is concerned while parsing the language in question; such behavior provides little to no benefit, it merely adds unnecessary complexity by polluting language with unnecessary detail which could be discerned from context simply by recognizing the context, parsing it and applying what’s observed from context to the particular bit being parsed by the reader at that particular moment in time. ;)
Please note that this is not a free service, even if the code is GPL. It costs $0.0002 / thumbnail returned / no charge if the thumbnail does not exist. http://www.amazon.com/gp/browse.html?node=236156011