?php/*php获取网站谷歌pr值完整示例*/function app_hash_url($url){$seed="Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE.";$result=0x01020345;for($i=0;$istrlen($url);$i++){$result^=ord($seed{$i%87})^ord($url{$i});$result=(($result23)0x1F
>23)&0x1FF)|$result<<9;
}
return sprintf("8%x",$result);
}
function get_pr($url){
$PR_CH=app_hash_url($url);
$url='/tbr?client=navclient-auto&features=Rank&q=info:'.$url.'&ch='.$PR_CH;
$prtext=file_get_contents($url);
if($prtext!=""){
$pr=explode(":",$prtext);
echo $pr[2];
}else{
echo 0;
}
}
echo get_pr("");
?>