IM使用此代碼:如何從php的api獲取所有的谷歌搜索結果?
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);
}
利用這一點,我剛剛從it.Is第1個'4結果有什麼辦法讓谷歌的整個搜索結果?
哦,它的工作well.but如何使用從這裏開始?會像這樣開始= XXX? – 2010-12-04 08:49:08