在Ruby中使用Google Search REST API

Dog*_*ert 8 ruby

我正在尝试使用Ruby进行谷歌搜索,并打印前3个结果.

谁能指点我一个示例代码?我找不到了.

Mar*_*une 7

宝石googleajax就在那里:

require 'googleajax'
GoogleAjax.referer = "your_domain_name_here.com"
GoogleAjax::Search.web("Hello world")[:results][0...3]
Run Code Online (Sandbox Code Playgroud)