1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <?php $query = 'PAROLE DA RICERCARE'; $query = urlencode($query); $url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=".$query; $body = file_get_contents($url); $json = json_decode($body); for($i=0;$i<count($json->responseData->results);$i++) { echo "<b>RISULTATO NUMERO: ".($i+1)."</b>"; echo "<br>URL: "; echo $json->responseData->results[$i]->url; echo "<br>Titolo: "; echo $json->responseData->results[$i]->title; echo "<br>Cotenuto: "; echo $json->responseData->results[$i]->content; echo "<br><br>"; } ?> |
Recuperare i risultati di una ricerca Google in PHP
In questo articolo vi mostrerò uno snippet in PHP per recuperare i risultati di una ricerca di una parola chiave effettuata con il motore di ricerca Google.
0 commenti:
Posta un commento