ruby on rails - Using Google Custom Search Engine through the google-api-client gem -


I am trying to wrap a basic search using the Google Custom Search Engine API. The problem I am facing is that only one result I am able to achieve is the first 10:

  module Voltserbaq class start GoogleCustomSearch def @client = Google :: APIClient.new (Key: Configatron.google.api_key, authorization: void) @search = @ client.discovered_api ('customscreens') End DIF query (Q, number) @ client.execute (api_method: @ search.cse.list, parameters: { Q: Q, startIndex: num, key: configatron.google.api_key, cx: configatron.google.custom_search_engine}) end end  

This code is quite simple but quite well I do: First of all I can start my GPC client using my API_Keyar, I can call it with any parameter, for example:

  client.query ( 'Poker', 10)  

Find your custom engine with string 'poker' and start from the 10th element of the result. My problem is that it is not working, I always get the same result, I will get it without the beginning option. The problem is probably that I do not know that the parameter has been given such a name, or if it is correct, then I can use it: I startIndex, start, start_index, num (This works one, but max Value 10, and I need at least 30 results), sometimes the parameter is rejected, sometimes it does not cause any effect.

Has anyone done something like this before and can help me?

From API Explorer:

It seems that the parameter you search for It is 'start': The first result (integer) to return the index is the number of other parameters (num) results.

You can try on the Explorer manually and see why it is not returning what you want.


Comments