June 09, 2004
Alexa API::[Search Engine]

All Alexa toolbar send request to data.alexa.com 80, here I give a short script to access data.alexa.com and get the XML output from alexa.
Simulate the alexa toolbar:
expect -re "Escape"
sleep 1
send "GET /data/TCaX/0+qO000fV?cli=10&dat=snba&ver=7.0&cdt=alx_vw%3D20%26wid%3D31472%26act%3D00000000000%26ss%3D1024x768%26bw
%3D639%26t%3D0%26ttl%3D4907%26vis%3D1%26rq%3D23&url=http://blog.wespoke.com/ HTTP/1.1\n"
send "Accept: */*\n "
send "Accept-Encoding: gzip, deflate \n"
send "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; Alexa Toolbar) \n"
send "Host: data.alexa.com \n"
send "\n"
send "\n"
interact
Output from Data.alexa.com: Alexa.xml
Trackback
You can ping this entry by using http://www.wespoke.com/cgi-bin/mt/mt-tb.cgi/494
Comments
coooool..I rewrote it by php
\n";
} else {
fputs($fp, "GET /data/TCaX/0+qO000fV?cli=10&dat=snba&ver=7.0&cdt=alx_vw%3D20%26wid%3D31472%26act%3D00000000000%26ss%3D1024x768%26bw%3D639%26t%3D0%26ttl%3D4907%26vis%3D1%26rq%3D23&url=".$my_url." HTTP/1.0\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate \r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; Alexa Toolbar) \r\nHost: ".$domain_name." \r\n\r\n");
while (!feof($fp)) {
$buffer .= fgets ($fp,1024);
}
fclose ($fp);
echo $buffer;
?>
test post date to www.alexa.com 测试
Posted by: fengyun at January 4, 2005 12:44 AM from 222.132.46.222