Comments\<\/h3>/",$page)) { $msg .= "photo $photoID has comments! "; //Find the comments within the HTML preg_match("/\
(.*?)\.*?Posted(.*?)\..*?\(.*?#comment(.*?)\"/is",$section[1],$comments);
//Loop through the comments
for ($i=0;$i
";
flush();
ob_flush();
sleep(1); #take a breather
}
}
//Sean Huber's CURL library (slightly modified), http://us2.php.net/curl
function doRequest($method, $url, $vars) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
if ($method == 'POST') {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
}
$data = curl_exec($ch);
curl_close($ch);
if ($data) {
return $data;
} else {
return curl_error($ch);
}
}
function get($url) {
return doRequest('GET', $url, 'NULL');
}
function post($url, $vars) {
return doRequest('POST', $url, $vars);
}
function printMySQLerror() {
print "Error: " . mysql_errno() . " : " . mysql_error() . "
";
}