Google PageRank PR Value online query PHP code

Source: Internet
Author: User

PR value is all called Pagerank.pagerank (page level) is a way for Google to evaluate the importance of a Web page. After blending all the other factors such as the title tag and the keywords logo, Google adjusts the results by PageRank. Make those more important pages in the search results of another site rankings to upgrade. Thus improving the relevance and quality of search results The PR value is up to 10. The general PR value is up to 4. Even a good website.

PageRank is a Google search ranking algorithm in a component, level from 1 to 10, 10 for full marks, the higher the PR value of the page in the search ranking more important, that is to say, in other conditions the same situation, PR-high sites have priority in the rankings of Google search results.

< php

Edit this to your website URL:
$myWebSite = http://www.mycodes.net ;





define (' Gmag ', 0xe6359a60);





//unsigned Shift Right


function Zerofill ($a, $b) {


$z = Hexdec (80000000);





if ($z &amp; $a) {


$a = ($a &gt;&gt;1);


$a &amp;= (~ $z);


$a |= 0x40000000;


$a = ($a &gt;&gt; ($b-1));


} else {


$a = ($a &gt;&gt; $b);


}





return $a;


}








function Mix ($a, $b, $c) {





$a-= $b; $a-= $c; $a ^= (Zerofill ($c, 13));


$b-= $c; $b-= $a; $b ^= ($a &lt; &amp;lt;8);


$c-= $a; $c-= $b; $c ^= (Zerofill ($b, 13));


$a-= $b; $a-= $c; $a ^= (Zerofill ($c, 12));


$b-= $c; $b-= $a; $b ^= ($a &lt;&amp;lt;16);


$c-= $a; $c-= $b; $c ^= (Zerofill ($b, 5));


$a-= $b; $a-= $c; $a ^= (Zerofill ($c, 3));


$b-= $c; $b-= $a; $b ^= ($a &lt;&amp;lt;10);


$c-= $a; $c-= $b; $c ^= (Zerofill ($b, 15));





return Array ($a, $b, $c);


}





function GCH ($url, $length =null, $init =gmag) {





if (Is_null ($length)) {


$length = sizeof ($url);


}





$a = $b = 0X9E3779B9;


$c = $init;


$k = 0;


$len = $length;





while ($len &gt;= 12) {


$a + + ($url [$k +0] + ($url [$k +1]&lt; &amp;lt;8) + ($url [$k +2]&lt;&amp;lt;16) + ($url [$k +3]&lt;&amp;lt;24)];


$b + + ($url [$k +4] + ($url [$k +5]&lt;&amp;lt;8) + ($url [$k +6]&lt;&amp;lt;16) + ($url [$k +7]&lt;&amp;lt;24)];


$c + + ($url [$k +8] + ($url [$k +9]&lt;&amp;lt;8) + ($url [$k +10]&lt;&amp;lt;16) + ($url [$k +11]&lt;&amp;lt;24)];


$mix = Mix ($a, $b, $c);


$a = $mix [0]; $b = $mix [1]; $c = $mix [2];


$k + 12;


$len-= 12;


}





$c + + $length;





switch ($len) {/* All of the case statements fall through * * *


Case: $c + + ($url [$k +10]&lt;&amp;lt;24);


Case: $c + + ($url [$k +9]&lt;&amp;lt;16);


Case 9: $c + + ($url [$k +8]&lt;&amp;lt;8);


/* the ' the ' the ' the ' the ' C ' is reserved for the length */


Case 8: $b + + ($url [$k +7]&lt;&amp;lt;24);


Case 7: $b + + ($url [$k +6]&lt;&amp;lt;16);


Case 6: $b + + ($url [$k +5]&lt;&amp;lt;8);


Case 5: $b + + ($url [$k +4]);


Case 4: $a + + ($url [$k +3]&lt;&amp;lt;24);


Case 3: $a + + ($url [$k +2]&lt;&amp;lt;16);


Case 2: $a + + ($url [$k +1]&lt;&amp;lt;8);


Case 1: $a + + ($url [$k +0]);


/* Case 0:nothing left to add * * *


}





$mix = Mix ($a, $b, $c);


/*--------------------------------------------The result * * *


return $mix [2];


}





//converts A string into an array of integers containing the numeric value of the char


function Strord ($string) {





for ($i =0; $i &lt;strlen ($string); $i + +) {


$result [$i] = Ord ($string {$i});


}





return $result;


}





function Getpr ($_url) {





$url = ' info: '. $_url;


$ch = GCH (Strord ($url));


$url = ' info: '. UrlEncode ($_url);


$pr = File ("http://www.google.com/search?client=navclient-auto&amp;ch=6$ch&amp;ie=utf-8&amp;oe=utf-8&amp; features=rank&amp;q= $url ");


$PR _str = Implode ("", $PR);





return substr ($pr _str,strrpos ($pr _str, ":") +1);


}





echo "&lt;br&gt;the PR of $myWebsite is:". GETPR ($myWebSite);


?&gt;


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.