一直在用的PR值获取方法突然不能用了,在网上找了这个方法,修改了下,primg是存放显示PR值图片的目录。 感兴趣的可以试下。 <?php $domain="www.gouhao.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); } function Gonten_prget($domain) { $GontenPRURL = "http://www.google.com/search?client=navclient-auto&features=Rank:&q=info:".$domain.'&ch='.HashURL($domain); $prstr = file_get_contents($GontenPRURL); $pagerank = substr($prstr,9); if ($pagerank){ return $pagerank; } else { return "0"; } } $pr = Gonten_prget($domain); ?> <img src="primg/<?php echo $pr.'.gif';?>"></img>