Hey Guys! I have stumbled across a PHP script that checks the validity of PageRank. Here is the 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 } ?> PHP: What the problem here is that it doesn't check properly. For everything it says for everything "Not Found" Demo: - http://www.asgsoft.biz/dev/fakepagerank.php Please can you help me out? Thanks
Yeah, I test it and it is not working. No results. And there is another free script to do this. I use it on my site. www.proxywhereabouts.com/pr.php
I don't think its ment to say "Not Found" for valid pagerank! Is there something wrong with the regex?
I don t know why, but after the last pagerank update, alot of fake pagerank checker tools stop working properly
Here is a working Fake PR checker for domains: <?php $domain=$_GET['domain']; if (isset($domain)) { $rurl = checkpagerank ($domain,false); $rurl = str_replace("www.","",$rurl);$rurl = str_replace("/","",$rurl); if ($rurl == "unknown") die ("unknown"); if ($rurl==$domain) { echo "valid"; } else { echo "fake: $rurl"; } } function checkpagerank($domain,$proxy) { $page = getPage('http://www.google.com/search?hl=en&q=info%3A'.$domain,'http://www.google.com/','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8',1,5,false); if (empty($page['ERR'])) { $result = $page['EXE']; } else { die('error connecting to site'); } $result = $page['EXE']; $re = "/<cite(.*)>(.*)<\/cite>/Uis"; preg_match($re,$result,$matches); if (isset($matches[0])) { return strip_tags($matches[0]); } else { return "unknown"; } } function getPage($url, $referer, $agent, $header, $timeout, $proxy=false) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, $header); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_REFERER, $referer); curl_setopt($ch, CURLOPT_USERAGENT, $agent); if ($proxy) curl_setopt($ch, CURLOPT_PROXY,$proxy); $result['EXE'] = curl_exec($ch); $result['INF'] = curl_getinfo($ch); $result['ERR'] = curl_error($ch); curl_close($ch); return $result; } ?> PHP: You need to also keep in mind that google will throttle you quickly and start sending messages saying "too many requests from this IP", causing an incorrect result...