Happy Holidays from blackhatzen:
Code:
<?php
if(isset($_POST['urls'])){
$urls = explode("\n",$_POST['urls']);
}
if(isset($_POST['contains'])){
$contains = preg_quote($_POST['contains'], "/");
}
?>
<html>
<head>
<title>blackhatzen obl check</title>
</head>
<body>
<form action="#" method="POST">
<table>
<tr>
<td width="50px"><strong>URLs:</strong></td>
<td><textarea name="urls" cols="50" rows="15"></textarea></td>
</tr>
<tr>
<td width="50px"><strong>Contains</strong></td>
<td><input type="text" name="contains" size="100" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" /></td>
</tr>
</table>
</form>
<?php
if(isset($urls)){
echo <<<HTML
<table border="1" width="500px">
HTML;
foreach($urls as $url){
$server = explode("/", $url);
$server = $server[2];
$html = file_get_contents($url);
$dom = new DOMDocument();
@$dom->loadHTML($html);
$xpath = new DOMXpath($dom);
$elements = $xpath->query("//head/title");
if(isset($elements)){
foreach($elements as $element){
$title = $element->nodeValue;
}
}
unset($element);
unset($elements);
$elements = $xpath->query("//a");
if(isset($elements)){
$count = 0;
$contains_count = 0;
foreach($elements as $element){
$link = $element->getAttribute("href");
if(!preg_match("/$server/i", $link) && preg_match("/^http/i", $link)){
if(isset($contains)){
if(preg_match("/$contains/i", $link)){
$contains_count++;
}
}
$count++;
}
}
}
echo "
<tr>
<th>URL</th>
<td>$url</td>
</tr>
<tr>
<th>Title</th>
<td>$title</td>
</tr>
<tr>
<th>OBL</th>
<td>$count</td>
</tr>
<tr>
<th>Contains</th>
<td>$contains_count</td>
</tr>";
unset($xpath);
unset($dom);
}
echo <<<HTML
</table>
HTML;
}
?>
</body>
</html>
One URL per line, must be a proper URI (like
http://blahblah.com/). Contains URL must also be a proper URI (like
http://blahblah.com/). Doesn't check for PR, because PR is worthless. Copy and paste into a .php file and upload to server.
I threw this together in like 10 minutes, so there are bound to be some bugs. Feel free to make with the hackety-hack for extra features. Try and sell this and Santa will crap in your mouth while you sleep.
osh out.