below to see I provide a PHP goolge PR query program code OH, well crap don't say more to see it.
below to see I provide a PHP goolge PR query program code OH, well crap don't say more to see it. The following function is used to check the PR
function Zerofill ($a, $b)
{
$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));
Return Array ($a, $b, $c);
}
function Googlech ($url, $length =null, $init =google_magic)
{
if (Is_null ($length))
{
$length = sizeof ($url);
}
$a = $b = 0X9E3779B9;
$c = $init;
$k = 0;
$len = $length;
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));
$mix = Mix ($a, $b, $c);
$a = $mix [0]; $b = $mix [1]; $c = $mix [2];
$k + = 12;
$len-= 12;
}
$c + = $length;
Switch ($len)
{
Case one: $c + = ($url [$k +10]<<24);
Case: $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]);
}
$mix = Mix ($a, $b, $c);
return $mix [2];
}
function Strord ($string) {
for ($i =0; $i
$result [$i] = Ord ($string {$i});
}
return $result;
}
function READPR ($link)
{
$fp = Fsockopen ("www.google.com", $errno, $errstr, 30);
if (! $fp)
{
echo "$errstr ($errno) n";
Exit (1);
}
Else
{
$out = "GET $link http/1.0rn";
$out. = "HOST:TOOLBARQUERIES.GOOGLE.COMRN";
$out. = "user-agent:mozilla/4.0 (compatible; Googletoolbar 2.0.114.9-big; Linux 2.6) RN ";
$out. = "Connection:closernrn";
Fwrite ($fp, $out);
do{
$line = fgets ($fp, 128);
}while ($line!== "RN");
$data = Fread ($fp, 8192);
Fclose ($FP);
return $data;
}
}
function Getpr ($url)
{
$url = ' info: '. $url;
$ch = Googlech (Strord ($url));
$data = READPR ("/search?client=navclient-auto&ch=6$ch&features=rank&q= $url");
$rankarray = Explode (': ', $data);
if (Trim ($rankarray [2])! = "") {
return $rankarray [2];
}
Else
return "0";
}
http://www.bkjia.com/PHPjc/445052.html www.bkjia.com true http://www.bkjia.com/PHPjc/445052.html techarticle below to see I provide a PHP goolge PR query program code OH, well crap don't say more to see it. below to see I provide a PHP goolge PR query program code Oh, good ...