<?
$urls=file('urls.txt');//each url on newline
foreach($urls as $url){
trim($url);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_REFERER, 'http://www.google.com/');
$AskApache_result = curl_exec ($ch);
$regex = '/<title>(.+?)<\/title>/';
preg_match($regex,$AskApache_result,$output);
// echo $output[1] . '<br>';
flush();
ob_flush();
curl_setopt ($ch, CURLOPT_URL, 'http://pingomatic.com/ping/?title=' . urlencode($output[1]) . '&blogurl=' . urlencode($url) . '&rssurl=http%3A%2F%2F&chk_weblogscom=on&chk_blogs=on&chk_technorati=on&chk_feedburner=on&chk_syndic8=on&chk_newsgator=on&chk_myyahoo=on&chk_pubsubcom=on&chk_blogdigger=on&chk_blogrolling=on&chk_blogstreet=on&chk_moreover=on&chk_weblogalot=on&chk_icerocket=on&chk_newsisfree=on&chk_topicexchange=on&chk_google=on&chk_tailrank=on&chk_bloglines=on&chk_postrank=on&chk_skygrid=on&chk_bitacoras=on&chk_collecta=on');
$AskApache_result = curl_exec ($ch);
if(preg_match('/Pinging complete!/', $AskApache_result))
{
echo "<a target=\"_blank\" href=\"".$url."\">".$url."</a> <b>Pinged!</b><br>";
$send_results .= $url." Pinged!\n";
}
else
{
echo $url . ' - <b>Pinging Failed!</b><br>';
$send_results .= $url . ' - Pinging Failed!\n';
}
flush();
ob_flush();
}
?>