Copy Code code as follows:
<% @LANGUAGE = "JAVASCRIPT"%>
<title>google PR Value Query ASP program </title>
<%
function Hexdec (str)
{
return parseint (str,16);
}
function Zerofill (a,b)
{
var z = hexdec (80000000);
if (Z & A)
{
A = a>>1;
a &= ~z;
a |= 0x40000000;
A = a>> (b-1);
}
Else
{
A = a >> b;
}
return (a);
}
function Mix (a,b,c)
{
A-= b; A = C; A ^= (Zerofill (c,13));
B-= C; B-= A; b ^= (a<<8);
c-= A; c-= b; C ^= (Zerofill (b,13));
A-= b; A = C; A ^= (Zerofill (c,12));
B-= C; B-= A; b ^= (a<<16);
c-= A; c-= b; C ^= (Zerofill (b,5));
A-= b; A = C; A ^= (Zerofill (c,3));
B-= C; B-= A; b ^= (A<<10);
c-= A; c-= b; C ^= (Zerofill (b,15));
var ret = new Array ((a), (b), (c));
return ret;
}
function Googlech (url,length)
{
var init = 0xe6359a60;
if (arguments.length = 1)
length = Url.length;
var a = 0x9e3779b9;
var B = 0x9e3779b9;
var c = 0xe6359a60;
var k = 0;
var len = length;
var mixo = new Array ();
while (Len >= 12)
{
A + + (Url[k+0] + (url[k+1]<<8) + (url[k+2]<<16) + (url[k+3]<<24));
B + + (Url[k+4] + (url[k+5]<<8) + (url[k+6]<<16) + (url[k+7]<<24));
C + + (Url[k+8] + (url[k+9]<<8) + (url[k+10]<<16) + (url[k+11]<<24));
Mixo = Mix (a,b,c);
A = mixo[0]; b = mixo[1]; c = mixo[2];
K + 12;
Len-= 12;
}
c = length;
Switch (len)
{
Case 11:
C + + url[k+10]<<24;
Case 10:
c+=url[k+9]<<16;
Case 9:
c+=url[k+8]<<8;
Case 8:
b+= (url[k+7]<<24);
Case 7:
b+= (URL[K+6]<<16);
Case 6:
b+= (URL[K+5]<<8);
Case 5:
b+= (Url[k+4]);
Case 4:
a+= (url[k+3]<<24);
Case 3:
a+= (URL[K+2]<<16);
Case 2:
a+= (URL[K+1]<<8);
Case 1:
a+= (url[k+0]);
}
Mixo = Mix (a,b,c);
if (Mixo[2] < 0)
Return (0x100000000 + mixo[2]);
Else
return mixo[2];
}
function Strord (s)
{
var re = new Array ();
for (i=0;i<s.length;i++)
{
Re[i] = s.charcodeat (i);
}
return re;
}
From the network, www.jb51.net
function C32to8bit (ARR32)
{
var arr8 = new Array ();
for (i=0;i<arr32.length;i++)
{
for (bitorder=i*4;bitorder<=i*4+3;bitorder++)
{
arr8[bitorder]=arr32[i]&255;
Arr32[i]=zerofill (Arr32[i], 8);
}
}
return ARR8;
}
function Myfmod (x,y)
{
var i = Math.floor (x/y);
return (x-i*y);
}
From the network, www. Pqshow. com
function Googlenewch (CH)
{
ch = ((CH/7) << 2) | ((Myfmod (ch,13)) &7);
Prbuf = new Array ();
PRBUF[0] = ch;
for (i = 1; i < i++) {
Prbuf[i] = prbuf[i-1]-9;
}
ch = Googlech (C32to8bit (PRBUF), 80);
return ch;
}
function UrlEncode (SSTR)
{
Return encodeURIComponent (SSTR). Replace (/\+/g, "%2b"). Replace (/\//g, "%2f");
}
function Getgooglehostinfo (URL) {
var reqgr = "info:" + URL;
var reqgre = "Info:" + urlencode (URL);
Response.Write (reqgr+ "<br>" +reqgre); From the network, www.jb51.net
GCH = Googlech (Strord (REQGR));
GCH = "6" + googlenewch (GCH);
var querystring = "Http://toolbarqueries.google.com/search?client=navclient-auto&ch=" + GCH + "&ie=UTF-8& oe=utf-8&features=rank:fvn&q= "+ Reqgre;
Response.Write (querystring); From the network, www.jb51.net
var objxmlhttp, XML;
XML = Server.CreateObject ("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[1]: "";
return PR;
}
function Getdirectory (temp) {
var foo = Temp.match (/fvn_.*?:.*:(?: top\/)? ([^\s]+)/I);
var cat = (foo)? FOO[1]: "";
if (cat!= "") cat= "http://directory.google.com/Top/" +cat
return cat;
}
From the network, www.jb51.net
var site;
Site= "www.baidu.com"; Input Station Roll Call
if (site!= "undefined") {
var google=getgooglehostinfo (site);
var pagerank=getpagerank (Google);
var directory=getdirectory (Google);
Response.Write ("PageRank:" +pagerank+ "<br>");
Response.Write ("Pagerank:<br>") ;
Response.Write ("Site:" +site+ "<br>");
if (directory!= "") Response.Write ("Site:<a href=" +directory+ ">" +directory+ "</a><br>");
}
%>
Save the above code as a pr.asp run, and if you want to pass a parameter, you can
Site= "www.baidu.com"; Input Station Roll Call
Replaced by
site=request.querystring ("url"); Input Station Roll Call