Alexa の pageview グラフをオーバレイで表示するブックマークレット

とりあえず即席で作ったので、ベタばり。

javascript:id='alxg',w=320,h=-192,d=document,z=d.getElementById(id);if(!z){z=d.createElement('iframe');z.id=id;with(z.style){position='absolute';right=0;top=h;width=w;height=-h;filter='alpha(opacity='+(opacity=0.8)*100+')'}z.frameBorder=z.marginWidth=z.marginHeight=0;z.src='http://traffic.alexa.com/graph?c=1&u='+encodeURIComponent(location.host)+'&r=6m&y=p&z=1&h='+-h+'&w='+w;d.body.appendChild(z);r=setInterval('if((z.style.top=h/=2)>-0.5)clearInterval(r);',100);}else{d.body.removeChild(z);}void(0);

下記が上のスクリプトを含む <a>タグです。

これをブックマークに追加してから、アドレスの先頭についている "http://www.example.com/#" をはずしてください。

IE はブックマークの文字数制限があるバージョンでは動きません。また、フレームが使われているページでも使えません。

追記: <div> コンテナをはずして文字数を削減、IE6 で使えるようにしてみました。