Continue: http://dev.robertmao.com/2008/07/28/get-alexa-image-signature/

To include a alexa image in your web page, add following:

<script src=”http://widgets.alexa.com/traffic/javascript/graph.js”></script>
<script src=”http://widgets.alexa.com/traffic/session/?domain=www.alexa.com&date=”></script>

function setAlexaImage(sites)
{
var html = “http://widgets.alexa.com/traffic/graph/?r=6m&y=r&z=3&h=400&w=648&c=1″;

for (var i in sites)
{
html+= “&u[]=”+sites[i];
}
var sig = AGraphManager.signature;
html+=’&x=’ + sig.expiry + ‘&check=www.alexa.com&signature=’+sig.signature;
$(”img#alexa_uv”)[0].src=html;
}

<img id=”alexa_uv” src=”#” />

I used jquery to get element, and used Alexa’s original code to  help to get the signature, but compose the image URL myself.

I didn’t try to rewrite alexa’s js code, I don’t want to reverse engineer it or change anything there, so just use their own code.

Popularity: 2% [?]



Leave a Comment

Close
E-mail It
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.