Файл: inc/tools/backlinks_checker/index.php
Строк: 59
<?
/*
Function to check Google Backlinks
*/
function google_backs($url){
$site = fopen('http://www.google.com/search?q=link%3A'.urlencode($url),'r');
while($cont = fread($site,1024657)){
$total .= $cont;
}
fclose($site);
$match_expression = '/of about <b>(.*)</b> linking to/Us';
preg_match($match_expression,$total,$matches);
return $matches[1];
}
/*
Function to check Yahoo Backlinks (Called inlinks)
*/
function yahoo_backs($url){
$site = fopen('http://siteexplorer.search.yahoo.com/search?p='.urlencode($url).'&bwm=i&bwmf=a&bwms=p','r');
while($cont = fread($site,1024657)){
$total .= $cont;
}
fclose($site);
$match_expression = '/of about <strong>(.*) </strong>/Us';
preg_match($match_expression,$total,$matches);
return $matches[1];
}
?>
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" align="center" class="ttable">
<tr>
<td bgcolor="#D4D0C8"><strong>Массовая проверка BackLinks по данным поисковых машин </strong></td>
</tr>
<tr>
<td align="center">список URLS:
<label>(начиная с "http://")</label>
<div align="center"></div></td>
</tr>
<tr>
<td align="center"><textarea name="urls" cols="70" rows="10" id="urls"></textarea></td>
</tr>
<tr>
<td align="center"><input type="submit" name="Submit" value="Проверить Backlinks" /></td>
</tr>
<tr>
<td><?php
if($_POST['urls'])
{
$urllist=explode("n", $_POST['urls']);
$url_count=count($urllist);
echo 'Количество URL для проверки: <b>'.$url_count.'</b><br><br>';
if($url_count)
{
echo '<table width="100%">';
for($i=0; $i<$url_count; $i++)
{
ob_flush(); flush();
$url=trim($urllist[$i]);
echo '<tr><td><b>URL:</b> '.$url.'</td><td>Google Backlinks: <b>'.google_backs($url).'</b></td>
<td>Yahoo Backlinks: <b>'.yahoo_backs($url).'</b></td>
</tr>';
usleep(10);
}
echo '</table>';
}
}
?></td>
</tr>
</table>
</form>