2010-12-04 1 views
2

これは私のコードですどのようなPHPのgoogleの検索APIと通信するときに開始パラメータの最大値は何ですか?

function doGoogleSearch($searchTerm,$start) 
{  

    $endpoint = 'web'; 
    $key= '...'; 
    $url = "http://ajax.googleapis.com/ajax/services/search/".$endpoint; 
    $args['q'] = $searchTerm; 
    $args['v'] = '1.0'; 
    $args['rsz']=8; 
    //$args['start']=8; 
    $args['key']="xxx"; 
    $url .= '?'.http_build_query($args, '', '&'); 
    $url.="&start=".$start; 
    $ch = curl_init()or die("Cannot init"); 
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);   
    //curl_setopt($ch, CURLOPT_REFERER, $referer); 
    $body = curl_exec($ch)or die("cannot execute"); 
    curl_close($ch); 
    //decode and return the response 
    return json_decode($body,1); 

} 

このコードを使って、私は約64のgoogle results.Afterを得ました。このようなメッセージがありました:

Array 
(
    [responseData] => 
    [responseDetails] => out of range start 
    [responseStatus] => 400 
) 

すべての結果を得る方法はありますか? google?

答えて

関連する問題