";
$bareurl = split('"',$url);
if ($links > 0) {
$sum = getsum($bareurl[1], $links);
}
elseif ($links == "") {
$sum = getsum($bareurl[1], $links);
}
else {
$sum = $url.",".$links."\r\n";
}
fwrite($out,$sum);
}
fclose($report);
fclose($out);
$duration = microtime_diff($timestart, microtime());
$duration = sprintf("%0.3f", $duration);
echo "
(" . $duration . " seconds)
";
echo 'You can download this report HERE';
echo "
Finished";
function getsum($url, $links) {
$ads = "";
$html = download_pretending($url,"Yellowbrickroad");
if ($html == "error")
$ads = "error";
$a = pc_link_extractor($html);
if ( find_adsense($html)) {
$ads = "adsense";
}
//echo "
" . $html . "
";
preg_match("/(.*)<\/title>/i", $html, $title);
print_r($title);
//$title = ExtractString($html, "", "");
echo "Title: " . $title[1] . "
";
//$sum = $url . ",". $num_bls . "\r\n";
$sum = $url.",".$links.",".count($a).",".$ads . ",\"".$title[1] . "\"\r\n";
return $sum;
}
function download_pretending($url,$user_agent) {
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 4);
$result = curl_exec ($ch);
if (curl_errno($ch)) {
print curl_error($ch);
curl_close($ch);
return "error";
}
else
curl_close($ch);
return $result;
}
function find_adsense($html) {
#looking for
#