Script to Get Google Page Rank Of a Site/Blog/Page

‘PAGE RANK’ is a trade mark of google and is patented by them.It is a link analysis algorithm which shows the relative importance of each site from another.Google rank varies from 1-10 where 10 is maximum.The page rank will be higher if you have more “do follow” links while “no follow” links are not considered for the calculation of page rank.You can have higher page rank by do follow commenting by finding appropriate blogs of your keyword.Refer DO FOLLOW SEARCH ENGINE and also High Page Rank Free Do-Follow Forums and Blogs
Various sites gives google page rank of a site and script for finding pr of the site is coded here.You can upload the file directly ,rename as php and then use it.Please give back a reciprocal link if you use the code,which will help me a lot

Download GOOGLE PAGE RANK SCRIPT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Script for Google PageRank</title>
<meta name="title" content="Google PageRank">
<meta name="author" content="www.techtipsmaster.com">
<meta name="publisher" content="TECH TIPS">
<meta http-equiv="content-language" content="es">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1><center>Script for Google PageRank</center> </h1>
<?php
if (isset($_POST['uri'])) $target=trim($_POST['uri']); else $target="";
?>
<table border="0" cellspacing="0" cellpadding="1"><tr><form action="googlepagerank.php" method="post"><td>
<table border="0" cellspacing="0" cellpadding="5"><tr><td>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td nowrap align=right>URL <i></i>:&nbsp;</td>
<td width=100%><input type="text" name="uri" size=25 maxlength=100 value="<?php echo $target; ?>"> Example: ("<a href="http://www.techtipsmaster.com">www.techtipsmaster.com</a>")</td></tr>
<tr><td></td><td><input type="submit" value="GET PAGERANK" name="submit"><input type="hidden" value="1" name="send"></td></tr>
</table>
</td></tr></table>
</td></form></tr></table>
<p>
<?php
// *** Google PageRank 1.1.1 ***
// Copyright (c) 2007 TECH TIPS
// http://www.techtipsmaster.com
function ZeroFill($a,$b){
$z=hexdec(80000000);
if($z&$a){
$a=($a>>1);
$a&=(~$z);
$a|=0x40000000;
$a=($a>>($b-1));
}else{
$a=($a>>$b);
}
return $a;
}
define('GOOGLE_MAGIC',0xE6359A60);
function Mix($a,$b,$c){
$a-=$b;$a-=$c;$a^=(ZeroFill($c,13));
$b-=$c;$b-=$a;$b^=($a<<8);
$c-=$a;$c-=$b;$c^=(ZeroFill($b,13));
$a-=$b;$a-=$c;$a^=(ZeroFill($c,12));
$b-=$c;$b-=$a;$b^=($a<<16);
$c-=$a;$c-=$b;$c^=(ZeroFill($b,5));
$a-=$b;$a-=$c;$a^=(ZeroFill($c,3));
$b-=$c;$b-=$a;$b^=($a<<10);
$c-=$a;$c-=$b;$c^=(ZeroFill($b,15));
return array($a,$b,$c);
}
function GoogleCH($url,$length=null,$init=GOOGLE_MAGIC){
if(is_null($length)){
$length=sizeof($url);
}
$a=$b=0x9E3779B9;
$c=$init;
$k=0;
$len=$length;
while($len>=12){
$a+=($url[$k+0]+($url[$k+1]<<8)+($url[$k+2]<<16)+($url[$k+3]<<24));
$b+=($url[$k+4]+($url[$k+5]<<8)+($url[$k+6]<<16)+($url[$k+7]<<24));
$c+=($url[$k+8]+($url[$k+9]<<8)+($url[$k+10]<<16)+($url[$k+11]<<24));
$mix=Mix($a,$b,$c);
$a=$mix[0];$b=$mix[1];$c=$mix[2];
$k+=12;
$len-=12;
}
$c+=$length;
switch($len){
case 11:$c+=($url[$k+10]<<24);
case 10:$c+=($url[$k+9]<<16);
case 9:$c+=($url[$k+8]<<8);
case 8:$b+=($url[$k+7]<<24);
case 7:$b+=($url[$k+6]<<16);
case 6:$b+=($url[$k+5]<<8);
case 5:$b+=($url[$k+4]);
case 4:$a+=($url[$k+3]<<24);
case 3:$a+=($url[$k+2]<<16);
case 2:$a+=($url[$k+1]<<8);
case 1:$a+=($url[$k+0]);
}
$mix=Mix($a,$b,$c);
return $mix[2];
}
function StringOrder($string){
for($i=0;$i<strlen($string);$i++){$result[$i]=ord($string{$i});}
return $result;
}
if($target!=""){
$server="www.google.com";
/* server alternativos
$server="toolbarqueries.google.com";
$server="64.233.161.99";
$server="64.233.161.104";
$server="66.102.7.99";
$server="66.102.7.104";
$server="216.239.59.99";
$server="216.239.59.104";
$server="216.239.37.104";
$server="216.239.39.99";
$server="216.239.39.104";
$server="66.102.11.99";
$server="66.102.11.104";
$server="216.239.57.99";
$server="216.239.57.104";
$server="66.102.9.99";
$server="66.102.9.104";
$server="216.239.53.99";
$server="216.239.53.104";
*/
$url="info:"."$target";
$ch=trim(str_replace("-","",sprintf("6%un",GoogleCH(StringOrder($url)))));
$res="http://$server/search?client=navclient-auto&ch=$ch&features=Rank&q=$url";
$data=@fopen("$res",r);
if($data){
while($line = fgets($data,1024)) {
if(substr($line,0,7)=="Rank_1:"){$rankline = $line;}
}
fclose($data);
$pagerank = trim(substr($rankline,9,2));
if($pagerank=="") $pagerank="0";
echo <<<HEADER
<h3>Information:</h3>
<blockquote>
<table border=0><tr>
<td>URL:&nbsp;&nbsp;</td>
HEADER;
echo "<td nowrap colspan=2><a href="http://".$target."">".$target."</a></td>n";
echo "</tr>";
echo "<tr>";
echo "<td nowrap>Pagerank:&nbsp;&nbsp;</td>";
echo "<td nowrap><b>".$pagerank."</b>&nbsp;&nbsp;</td> \n";
echo "<td nowrap> \n";
echo "<table border=0 cellspacing=0 title="Google PageRank ".$pagerank;
echo "/10\" style=\"height:1px;border:1px solid #888888;\"><tr>\n";
$out="";
for($i=1;$i<=$pagerank;$i++){$out.="<td bgcolor=#88cc88><small>&nbsp;$i&nbsp;</small></td>n";}
for($i=$pagerank+1;$i<=10;$i++){$out.="<td bgcolor=#ffffff><small>&nbsp;$i&nbsp;</small></td>n";}
echo $out;
echo <<<FOOTER
</tr></table>
</td></tr></table>
</blockquote>
<p>Script to find PageRank by: <a href="http://www.techtipsmaster.com/" target="_blank">www.techtipsmaster.com</p>
FOOTER;
}else{
echo "<p><b>WRONG URL FORMAT!</b></p>n";
}
}
?>
</p>
</body>
</html>

3 Responses to “Script to Get Google Page Rank Of a Site/Blog/Page”

  1. This is really too complicated for me! Do you know a shortcut somehow?

  2. excellent code for google page rank theory, its difficult for me to understand but its good for resource.

  3. Hi buddy,

    Thanks for this working script.

    It’s working fine on my home server but not on the Online one.

    You can check it live at http://ajdeskta.com/pr/pr-old/ .

    If possible please help me to rectify the problem.

Leave a Reply