I'm using the API for Custom Search Engine for Ruby from Google. This is how I set the API after call Google::APIClient.new
:
response = client.execute(
:api_method => search.cse.list,
:application_name => 'my_app',
:application_version => '0.1',
:parameters => {
'q' => thekey,
'num' => 4,
'start' => 1,
'key' => 'MYKEY',
'cx' => 'MYCX'
}
)
The request gone, but I can't reach the next page's results. If I run client.execute(response.next_page)
obtain the same data of the first API call.
response.next_page
return this:
irb(main):015:0> response.next_page => #"ordine dei geometri", "num"=>4, "start"=>1, "key"=>"MYKEY", "cx"=>"MYCX", "pageToken"=>nil}, @headers={"User-Agent"=>"google-api-ruby-client/0.7.1 Mac OS X/10.9.4\n (gzip)", "Accept-Encoding"=>"gzip", "Content-Type"=>""}, @api_method=#, @authenticated=nil, @authorization=nil, @body
You see that start
parameter is set to 1
even if the first response
returned
"queries"=>{"nextPage"=>['start' => 5}
Instead:
response.next_page_token
is ever nil
.
I tried to search (this not working for me) but documentation is quite strange about Google API Ruby client.