Buenas,
Me bajé este script desde phpclasses.org:
http://www.phpclasses.org/browse/file/11612.html
En local me da el PR perfecto, pero...cuando lo subo a mi servidor me da todo PR1! Alguien sabe porque puede pasar esto????...
Pueden verlo aquí:
http://www.pspes.org/includes/pr/test.php
Aqui les dejo el codigo del test.php
Código PHP:
<html>
<head>
<title>Google PageRank Test Suite</title>
</head>
<body>
<form method="POST" action="<?=$_SERVER["PHP_SELF"];?>">
<input type="hidden" name="checkPr" value="1">
<p>Enter URL's (one for each line) to check Google PageRank:<br>
<textarea rows="6" name="urls" cols="50" nowrap>
<?PHP
if ($_POST["checkPr"] == 1) echo $_POST["urls"];
else echo "http://www.phpclasses.org\nhttp://www.progen.com.tr\nhttp://www.hotscripts.com\nhttp://www.google.com";
?>
</textarea><br>
<input type="checkbox" value="1" name="useCache" <?=$_POST["useCache"]==1? "CHECKED":""?>> Use caching<br>
<input type="checkbox" value="1" name="printDebug" <?=$_POST["printDebug"]==1? "CHECKED":""?>> Print debug<br>
<input type="submit" value="Check PageRanks"></p>
</form>
<?PHP
if ($_POST["checkPr"] == 1) {
?>
<table border="0" cellpadding="3" cellspacing="0" id="table1">
<tr>
<td><font color="#FF9900"><b>PageRank</b></font></td>
<td><font color="#FF9900"><b>Exec Time</b></font></td>
<td><font color="#FF9900"><b>URL</b></font></td>
</tr>
<?
$url = explode("\n",$_POST["urls"]);
include_once("class.googlepr.php");
$gpr = new GooglePR();
$gpr->debug=true;
$gpr->useCache = ($_POST["useCache"]==1)? true:false;
$gpr->userAgent = $_SERVER["HTTP_USER_AGENT"];
for ($i=0;$i<count($url);$i++) {
if (strlen(trim($url[$i]))>0) {
$_url = eregi("http://",$url[$i])? $url[$i]:"http://".$url[$i];
$pr = $gpr->GetPR($_url);
?>
<tr>
<td valign="top">
<div align="center">
<table border="0" cellspacing="0" id="table2">
<tr>
<td>
<p align="center"><b><font face="Arial" size="1"><?=$pr?>/10</font></b></td>
</tr>
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="0" id="table3" style="border: 1px solid
#000000" width="50" height="5">
<tr>
<td bgcolor="#008000" width="<?=($pr*5)?>"></td>
<?PHP if($pr<10) {?><td width="<?=(50-$pr*5)?>"></td><?PHP } ?>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
<td valign="top"><?=round(substr($gpr->debugResult["total_exec_time"],0,strpos($gpr->debugResult["total_exec_time"]," ")),6)?> sec(s)</td>
<td><a href="<?=$_url?>" target="_blank"><?=$_url?></a>
<? if ($_POST["printDebug"]==1) {?>
<pre><?print_r($gpr->debugResult);unset($gpr->debugResult);?></pre>
<?}?>
</td>
</tr>
<?PHP
}
}
?>
</table>
<?PHP
}
?>
</body>
</html>
Da PR1 a GOOGLE! jaja, Un saludo!