reateObject("Microsoft.XMLHTTP");
xml.Open("GET", querystring, false);
xml.setRequestHeader( "User-Agent", "Mozilla/4.0 (compatible; GoogleToolbar 2.0.114-big; Windows XP 5.1)" );
xml.send();
return xml.responseText;
}
function getPageRank(temp){
var foo = temp.match(/Rank_.*?:.*?:(\d+)/i);
var pr = (foo) ? foo : "";
return pr;
}
function getDirectory(temp){
var foo = temp.match(/FVN_.*?:.*?:(?:Top\/)?([^\s]+)/i);
var cat = (foo) ? foo : "";
if(cat!="")cat="http://directory.google.com/Top/"+cat
return cat;
}
//来源于网络,www.jb51.net
var site;
site="www.baidu.com"; //输入站点名
if(site!="undefined"){
var google=getGoogleHostInfo(site);
var pagerank=getPageRank(google);
var directory=getDirectory(google);
Response.Write("PageRank:"+pagerank+"<br>");
Response.Write("PageRank:<img src=\"images/pr"+pagerank+".png\" alt=\"PageRank:"+pagerank+"\"><br>");
Response.Write("Site:"+site+"<br>");
if(directory!="")Response.Write("Site:<a href="+directory+">"+directory+"</a><br>");
}
%>
将上面的代码保存为pr.asp运行即可,如果想要传参,可以将
site="www.baidu.com"; //输入站点名
替换为
site=Request.QueryString("url"); //输入站点名