Home > Backend Development > PHP Tutorial > php获取网站谷歌pr值方法

php获取网站谷歌pr值方法

WBOY
Release: 2016-06-20 13:01:48
Original
1204 people have browsed it

利用php获取网站的谷歌pr值。

方法如下:

<p>function app_hash_url($url){</p> $seed="Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE.";<br /> $result=0x01020345;<br /> for($i=0;$i<strlen($url);$i++){<br /> $result^=ord($seed{$i%87})^ord($url{$i});<br /> $result=(($result>>23)&0x1FF)|$result<<9;<br /> }<br /> return sprintf("8%x",$result);<br /><p>}
Copy after login

php完整获取谷歌pr值的实例如下:

<p>/*php获取网站谷歌pr值完整示例*/</p>$url='www.scutephp.com';<br />function app_hash_url($url){<br /> $seed="Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE.";<br /> $result=0x01020345;<br /> for($i=0;$i<strlen($url);$i++){<br /> $result^=ord($seed{$i%87})^ord($url{$i});<br /> $result=(($result>>23)&0x1FF)|$result<<9;<br /> }<br /> return sprintf("8%x",$result);<br />}<br />$PR_CH=app_hash_url($url);<br />$url='http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank&q=info:'.$url.'&ch='.$PR_CH;<br />echo file_get_contents($url);
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template