<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_44641"> <div class="blockcode"> <div id="code_d6W"><ol> <li> <li> <?php <li>/*</li> <li>* 功能:对URL进行编码</li> <li>* 参数说明:$web_url 网站URL,不包含"http://"</li> <li>* site: bbs.it-home.org</li> <li>*/</li> <li>function HashURL($url)</li> <li>{ </li> <li> $SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";</li> <li> $Result = 0x01020345;</li> <li> for ($i=0; $i<strlen> {<li> $Result ^= ord($SEED{$i%87}) ^ ord($url{$i});</li> <li> $Result = (($Result >> 23) & 0x1FF) | $Result }</li> <li> return sprintf("8%x", $Result);</li> <li>}</li> <li>/*</li> <li>*功能:根据google提供的pr查询接口获取pagerank</li> <li>*参数说明:$domain 网站域名,不包含"http://"</li> <li>*/</li> <li>function pagerank($domain)</li> <li>{ </li> <li> $StartURL = "http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank:&q=info:";</li> <li> $GoogleURL = $StartURL.$domain. '&ch='.HashURL($domain);</li> <li> echo $GoogleURL.'<br>';</li> <li> $fcontents = file_get_contents("$GoogleURL");</li> <li> $pagerank = substr($fcontents,9);</li> <li> if (!$pagerank) return "0";else return $pagerank;</li> <li>}</li> <li>echo pagerank("phpddt.com");</li> <li>?></li></strlen> </li> </ol></div> <em onclick="copycode($('code_d6W'));">复制代码</em> </div> </td></tr></table> <div id="comment_44641" class="cm"> </div> <div id="post_rate_div_44641"></div> <br><br>