PR the latest with PHP to get Google PR value algorithm, attach PHP query PR Value code example

Source: Internet
Author: User
Copy CodeThe code is as follows:


/*
* Function: Encode the URL
* Parameter description: $web _url website URL, does not contain "http://", such as Jb51.net
*/
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
{
$Result ^= Ord ($SEED {$i%87}) ^ ord ($url {$i});
$Result = (($Result >>) & 0x1ff) | $Result << 9;
}
Return sprintf ("8%x", $Result);
}
/*
* Function: Get PageRank
* Parameter description: $domain website domain name, does not contain "http://",
*/
function PageRank ($domain)
{
$StartURL = "Http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank:&q=info:";
$StartURL = "Http://www.google.com/search?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;
}


I write the PR query tool is like this, but a little to explain, PR sometimes query a little slow, some people say why other people's station query quickly, in fact, a lot of PR query stations have done a variety of caches, because the PR general situation, will not change, unless Google PR update, hehe.

The above introduces the latest PR-Google PR value algorithm, with PHP query PR value code example, including the PR aspect of the content, I hope that the PHP tutorial interested friends helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.