The latest Google prvalue algorithm obtained using PHP, And the PHP query prvalue code example is attached.

Source: Internet
Author: User

CopyCode The Code is as follows :/*
* Function: encode the URL
* Parameter description: $ web_url URL, which does not contain "http: //", for example, 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 <strlen ($ URL); $ I ++)
{
$ Result ^ = ord ($ seed {$ I % 87}) ^ ord ($ URL {$ I });
$ Result = ($ result> 23) & 0x1ff) | $ result <9;
}
Return sprintf ("8% X", $ result );
}
/*
* Function: Obtain PageRank
* Parameter description: $ domain website domain name, excluding "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;
}

the PR query tool I wrote is like this, but it should be noted that PR queries are sometimes slow, and some people say why others' sites query quickly. In fact, many PR query sites have implemented various caches, because PR usually does not change unless Google PR is updated.

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.