您好,欢迎访问一九零五行业门户网

最新Google PR查询工具GoogleCH函数核心代码

取自国外编程开发技术论坛里的代码,最新google pr查询工具googlech函数核心代码,获取最新的google pr值.
代码如下.
[code] $val)
     {
         switch ($val['type'])
         {
           case 'complete':
               array_push($hash_stack, $val['tag']);
               $type = implode($hash_stack, ][);
               if ($type == rk)
               {
                 $pagerank = $val[value];
               }
               array_pop($hash_stack);
           break;
         }//swhitch
     }//foreach
return $pagerank;
}//obtainpr
//unsigned shift right
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  $c -= $a; $c -= $b; $c ^= (zerofill($b,13));
  $a -= $b; $a -= $c; $a ^= (zerofill($c,12));
  $b -= $c; $b -= $a; $b ^= ($a  $c -= $a; $c -= $b; $c ^= (zerofill($b,5));
  $a -= $b; $a -= $c; $a ^= (zerofill($c,3)); 
  $b -= $c; $b -= $a; $b ^= ($a  $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]        $b += ($url[$k+4] +($url[$k+5]        $c += ($url[$k+8] +($url[$k+9]        $mix = mix($a,$b,$c);
        $a = $mix[0]; $b = $mix[1]; $c = $mix[2];
        $k += 12;
        $len -= 12;
    }
    $c += $length;
    switch($len)              /* all the case statements fall through */
    {
        case 11: $c+=($url[$k+10]        case 10: $c+=($url[$k+9]        case 9 : $c+=($url[$k+8]          /* the first byte of c is reserved for the length */
        case 8 : $b+=($url[$k+7]        case 7 : $b+=($url[$k+6]        case 6 : $b+=($url[$k+5]        case 5 : $b+=($url[$k+4]);
        case 4 : $a+=($url[$k+3]        case 3 : $a+=($url[$k+2]        case 2 : $a+=($url[$k+1]        case 1 : $a+=($url[$k+0]);
         /* case 0: nothing left to add */
    }
    $mix = mix($a,$b,$c);
    /*-------------------------------------------- report the result */
    return $mix[2];
}
//converts a string into an array of integers containing the numeric value of the char
function strord($string) {
    for($i=0;$i        $result[$i] = ord($string{$i});
    }
    return $result;
}
// converts an array of 32 bit integers into an array with 8 bit values. equivalent to (byte *)arr32
function c32to8bit($arr32) {
    for($i=0;$i        for ($bitorder=$i*4;$bitorder            $arr8[$bitorder]=$arr32[$i]&255;
            $arr32[$i]=zerofill($arr32[$i], 8);
        }   
    }
    return $arr8;
}
// http://www.example.com/ - checksum: 6540747202
print(url .... $url\n);
$url = 'info:' . $url;
$ch = googlech(strord($url));
$url_to_parse = sprintf (http://toolbarqueries.google.com/search?client=navclient-auto&ch=6%u&ie=utf-8&oe=utf-8&q=%s, $ch, $url);
$value = obtainpr(file_get_contents($url_to_parse));
printf(
checksum ..... 6%u ...... link .... pr = $value\n,$ch);
$ch=sprintf(%u, $ch);
// new since toolbar 2.0.114$ch = ((($ch/7) $prbuf = array();
$prbuf[0] = $ch;
for($i = 1; $i       $prbuf[$i] = $prbuf[$i-1]-9;
}
$ch = googlech(c32to8bit($prbuf), 80);
$url_to_parse = sprintf (http://toolbarqueries.google.com/search?client=navclient-auto&ch=6%u&ie=utf-8&oe=utf-8&q=%s, $ch, $url);
$value = obtainpr(file_get_contents($url_to_parse));
//
printf(
checksum >=2.0.114: ..... 6%u ...... link .... pr = $value\n,$ch);
?>[/code]
其它类似信息

推荐信息