- Impact
- 15
Just posting this for people that want something that will check a lot of fake page ranks. I have not tested it fully, but I think upwards of 500~3000 would be a limit.
The output is in the form of a csv delimited file. You can copy and paste the output into a file NAMEME.csv and open up in a excel type of spreadsheet software. Sort the results and there you go. :D If it can not find the info: page it will print out the url of the site with a link to the info:. I have came accross a few that showed that it was pointing towards another domain. I am not that great at preg_match so if someone would update it so it would not return a false not found.
This is not a public domain script. You may not sell, resell it. You can not publish it on other forums, websites, and etc without the copyright notice in place. You may not claim the work as you own. All rights remain with AllStar of Onic Designs.
fakepagerank.php (paste your list into the box without the http:// on the url.
www is just fine to have.
(this code below is copyright the orginal author)
getpr.php
The output is in the form of a csv delimited file. You can copy and paste the output into a file NAMEME.csv and open up in a excel type of spreadsheet software. Sort the results and there you go. :D If it can not find the info: page it will print out the url of the site with a link to the info:. I have came accross a few that showed that it was pointing towards another domain. I am not that great at preg_match so if someone would update it so it would not return a false not found.
This is not a public domain script. You may not sell, resell it. You can not publish it on other forums, websites, and etc without the copyright notice in place. You may not claim the work as you own. All rights remain with AllStar of Onic Designs.
fakepagerank.php (paste your list into the box without the http:// on the url.
www is just fine to have.
Code:
<?php
//copyright 2007 -> AllStar -> http://onicdesigns.com
set_time_limit(0);
ob_start();
function getweb($website)
{
if(!$ch = curl_init($website)) {
echo "Could not connect to $website";
return;
}
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
curl_close ($ch);
return $output;
}
function checkpagerank($url)
{
$total = getweb('http://www.google.com/search?hl=en&q=info%3A'.urlencode($url));
$match_expression = '/<span class\=a>(.*)\/<\/span><\/font>/i';
preg_match($match_expression,$total,$matches);
return strip_tags($matches[1]);
}
function sayln($str)
{
echo $str."<br />";
ob_flush();
flush();
return;
}
include_once('getpr.php');
$google = new google_pr();
if(isset($_POST['submit']))
{
sayln('Checking for valid pageranks :) Wee...');
$domains = explode("\n", $_POST['domains']);
foreach($domains as $domain)
{
$rurl = null;
$domain = trim($domain);
$rurl = checkpagerank($domain);
if($rurl == $domain)
{
$pagerank = trim($google->get_page_rank('http://'.$domain));
if($pagerank != 0)
{
sayln($rurl.','.$pagerank);
}
}
elseif($rurl == '')
{
$pagerank = trim($google->get_page_rank('http://'.$domain));
if($pagerank != 0)
{
sayln('<a href="http://www.google.com/search?hl=en&q=info%3A'.urlencode($domain).'">'.$domain.'</a>,'.$pagerank.',not found');
}
}
}
}
else
{
?>
<div style="text-align: center">
<form action="fakepagerank.php" method="post">
<textarea name="domains" cols="100" rows="20"></textarea>
<br /><input type="submit" name="submit" value="Check For Valid Pagerank!" style="font-size: 30pt;" />
</form>
</div>
<?php } ?>
(this code below is copyright the orginal author)
getpr.php
Code:
<?php
define('GOOGLE_MAGIC', 0x00000000E6359A60); // CHANGED (64Bit)
class google_pr
{
var $checksum;
function google_pr(){
$this->checksum='';
}
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;
}
function mix($a,$b,$c) {
$a -= $b; $a -= $c; $this->toInt32($a); $a = (int)($a ^ ($this->zeroFill($c,13)));
$b -= $c; $b -= $a; $this->toInt32($b); $b = (int)($b ^ ($a<<8));
$c -= $a; $c -= $b; $this->toInt32($c); $c = (int)($c ^ ($this->zeroFill($b,13)));
$a -= $b; $a -= $c; $this->toInt32($a); $a = (int)($a ^ ($this->zeroFill($c,12)));
$b -= $c; $b -= $a; $this->toInt32($b); $b = (int)($b ^ ($a<<16));
$c -= $a; $c -= $b; $this->toInt32($c); $c = (int)($c ^ ($this->zeroFill($b,5)));
$a -= $b; $a -= $c; $this->toInt32($a); $a = (int)($a ^ ($this->zeroFill($c,3)));
$b -= $c; $b -= $a; $this->toInt32($b); $b = (int)($b ^ ($a<<10));
$c -= $a; $c -= $b; $this->toInt32($c); $c = (int)($c ^ ($this->zeroFill($b,15)));
return array($a,$b,$c);
}
function strord($string) {
for($i=0;$i<strlen($string);$i++) {
$result[$i] = ord($string{$i});
}
return $result;
}
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 = $this->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 = $this->mix($a,$b,$c);
return $mix[2];
}
function getGoogleChecksum($url) {
$url="info:"."http://".str_replace('http://','',$url);
$tmp_ch=$this->strord($url);
$this->checksum=sprintf("%u", $this->GoogleCH($tmp_ch));
return $this->checksum;
}
function toInt32(& $x) {
$z = hexdec(80000000);
$y = (int)$x;
if($y==-$z&&$x<-$z){
$y = (int)((-1)*$x);
$y = (-1)*$y;
}
$x = $y;
}
function get_page_rank($url){
$reqgr = "info:".$url;
$reqgre = "info:".urlencode($url);
$gch="6".$this->getGoogleChecksum($url);
$patern = '/^http:/';
$patern2 = '/^http:\/\/.*google\..*\/(search|images|groups|news).*/';
$patern3 = '/^http:\/\/localhost.*/';
$patern4 = '/^http:\/\/(127\.|10\.|172\.16|192\.168).*/'; //local ip
if(!preg_match($patern, $url) || preg_match($patern2, $url) ||
preg_match($patern3, $url) || preg_match($patern4, $url)){
return -1;
}
else
{
$website = "http://toolbarqueries.google.com/search?client=navclient-auto&ch=".$gch."&ie=UTF-8&oe=UTF-8&features=Rank&q=".$reqgre;
if(!$ch = curl_init($website)) {
return 'Count not connect to google.com';
}
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; GoogleToolbar 3.0.114-big; Windows XP 5.1)');
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$res['content'] = curl_exec($ch);
curl_close ($ch);
if(preg_match('/Rank_.*?:.*?:(\d+)/i', $res['content'], $m))
{
return $m[1];
}
else
{
return 0;
}
}
}
}
?>
Last edited: