Display alexa traffic image elsewhere


Display alexa traffic image elsewhere

Published on Sun 03 Aug 2008 10:08 ( 1 year, 7 months ago)
Web Web analytics

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.


Related posts:


Search related in web:

Custom Search

RSS Feed

One click subscribe this blog in your google reader!

Be social!


Want to say something here? please sign in



Blog posts link to this page
What are friends tweeting?
Tags cloud
Monthly Archives