Forse il problema è nei risultati della pagina...
intendo, tramite questo script dovrei leggere i link tra i risultati di google
ma non vorrei che google, ora, in qualche modo non renda visibili gli URL
cosa ne pensate??
Codice PHP:
$gg_url = 'http://www.google.it/search?hl=it&q=' . urlencode($_GET['keyword']) . '&start=';
echo '1';
echo $gg_url;
$url = preg_replace('(^[url]http://[/url]|/$)','',$_GET['url']);
echo "
";
echo "2";
echo $url;
for ($page = 0; $page < 9; $page++) {
$handle = fopen($gg_url . $page . 0 ,'r');
$scraped = '';
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
$scraped .= $buffer;
}
fclose($handle);
}
$results = array();
preg_match_all('/a href="([^"]+)" class=l.+?>.+?<\/a>/',$scraped,$results);