Число страниц в индексе Google:
<?
function google_pages($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.google.com/search?&q=site:{$url}&hl=en%5C");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com/");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$str=curl_exec($ch);
curl_close($ch);
if(!preg_match("/<div id=resultStats>About (.*) results<nobr>/s", $str,$find)) preg_match("/<div id=resultStats>(.*) result(.*)<nobr>/s", $str,$find);
if(preg_match("/did not match any documents/s", $str)){$res=0;} else {$res=trim($find['1']);}
return $res;
}
?>