0

我有这段代码

require 'google/api_client'
require 'google/api_client/client_secrets'
require 'google/api_client/auth/installed_app'

search_client = Google::APIClient.new(
  :application_name => 'Application'
)

google_search = search_client.discovered_api('customsearch')

# Load client secrets from your client_secrets.json.
client_secrets = Google::APIClient::ClientSecrets.load   

search_client.authorization = nil

response = search_client.execute(google_search.cse.list, 'q' => 'query')

在 IRB 中加载该文件后,我得到了类似的结果

#<Google::APIClient::Result:0xad56844>
=> true

我如何使用该结果,例如将其解析为有意义的内容?

4

1 回答 1

1

在最后一行之后添加:

status, headers, body = response
于 2014-05-19T04:15:51.907 回答