Php kendi API tüm google arama sonuçları elde etmek nasıl?

0 Cevap

Bu kodu kullanarak im:

function doGoogleSearch($searchTerm)
  {
   //$cx="002000009380213215808:hf9v-g9oyho";        
    $endpoint = 'web';
    $key= 'XXX';
    $url = "http://ajax.googleapis.com/ajax/services/search/".$endpoint;

    $args['q'] = $searchTerm;
    $args['v'] = '1.0';

    $url .= '?'.http_build_query($args, '', '&');

    $ch = curl_init()or die("Cannot init");
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);        
    $body = curl_exec($ch)or die("cannot execute");
    curl_close($ch);
    //decode and return the response
    return json_decode($body,1);
  }

Bu kullanarak ben sadece it.Is gelen 1'st 4 sonuç google tüm arama sonucu almak için herhangi bir yolu var mı?

0 Cevap