I posted the full code and detailed information about the problems and workarounds (using the api key) in
the abode code - google-api-client for ruby
After installing the gem, getting the Google API key and setting up a user search account (with its prefixes extended for all web pages) .... I could trawl Google search results in irb with the following (copy paste to irb and then check answer when done):
require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
require 'google/api_client'
client = Google::APIClient.new(:key => 'your-api-key', :authorization => nil)
search = client.discovered_api('customsearch')
response = client.execute(
:api_method => search.cse.list,
:parameters => {
'q' => 'the hoff',
'key' => 'your-api-key',
'cx' => 'your-custom-search-id'
}
)
google api oauth. : ... , api , oauth. 401.