ASP complete Google PR query program

Source: Internet
Author: User
Tags urlencode

Google to the PR query encryption, ASP version of the PR query code is very rare, today found a, to the need for the webmaster, complete code as follows:
<% @LANGUAGE = "JAVASCRIPT"%>
<form name= "Zzsky" method= "Get" action= "" >
<input type= "text" name= "Site" >
<input type= "Submit" name= "Submit" value= "Enquiry" >
</form>
<%
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&LT;&LT;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]&LT;&LT;16);
Case 6:
b+= (URL[K+5]&LT;&LT;8);
Case 5:
b+= (Url[k+4]);
Case 4:
a+= (url[k+3]<<24);
Case 3:
a+= (URL[K+2]&LT;&LT;16);
Case 2:
a+= (URL[K+1]&LT;&LT;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;
}
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);
}
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);
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);
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 ();
Response.Write (Xml.responsetext);
Response.Write (Xml.responsebody);
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;
}
var site;
Site=request ("site");
if (site!= "undefined") {
var google=getgooglehostinfo (site);
var pagerank=getpagerank (Google);
var directory=getdirectory (Google);
Response.Write ("PageRank:" +pagerank+ "<br>");
Response.Write ("Website:" +site+ "<br>");
if (directory!= "") Response.Write ("Directory: <a href=" +directory+ ">" +directory+ "</a><br>");
}
%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.