Php code for obtaining googlepr values

Source: Internet
Author: User
Function: encode a URL. the URL does not contain quot;. for example, the code of phprm. comphp to obtain the googlepr value is as follows :? Phpf... function: encode the URL

Parameter description: $ web_url does not contain "http: //", for example, phprm.com

The php code for obtaining the google pr value is as follows:

 > 23) & 0x1FF) | $Result << 9;    }    return sprintf("8%x", $Result);}

Function:

Description of obtaining pagerank parameters:

$ Domain: the website domain name does not contain "http: //". the code is as follows:

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;}

OK. it's actually that simple to use php to get Google's prvalue algorithm. let's test it by yourself. last time, Google's prvalue query interface was changed, the code above has been modified to use the latest interface of Google PR query.

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.