最近站长论坛到处可见Google取消PR的说法,都说Google已彻底放弃PR,全部清0,但部分站长又发现谷歌插件上能查出,所以原因就是Google PR查询的参数有改变,谷歌并未取消PR值,实乃API地址更新所致。
找到你PR查询的文件,找到原Google PR查询地址,修改几个参数便正常了,代码如下:
原代码:http://www.google.com/search?client=navclient-auto& features=Rank&ch=8f3b58e04&q=info:www.true123.cn
现代码:http://toolbarqueries.google.com/tbr?client=navclient-auto& features=Rank&ch=8f3b58e04&q=info:www.true123.cn
PR查询代码:
<?php
/*
*功能:对URL进行编码
*参数说明:$web_url 网站URL,不包含"http://",例如www.526net.com
*/
function HashURL($url)
{$SEED = "Mining PageRank is AGAINST GOOGLE’S TERMS OF SERVICE. Yes, I’m talking to you, scammer.";
$Result = 0x01020345;
for ($i=0; $i<strlen($url); $i++)
{
$Result ^= ord($SEED{$i%87}) ^ ord($url{$i});
$Result = (($Result >> 23) & 0x1FF) | $Result << 9;
}
return sprintf("8%x", $Result);
}/*
*功能:获取pagerank
*参数说明:$domain 网站域名,不包含"http://",例如www.526net.com
*/
function pagerank($domain)
{ //http://toolbarqueries.google.com/tbr?client=navclient-auto& features=Rank&ch=8f3b58e04&q=info:james.slaterspage.com
$StartURL = "http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank&q=info:";$GoogleURL = $StartURL.$domain. ‘&ch=’.HashURL($domain);
$fcontents = file_get_contents("$GoogleURL");
$pagerank = substr($fcontents,9);
if (!$pagerank) return "0";else return $pagerank;
}
?>