Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Google Search REST API in Ruby

Tags:

ruby

I'm trying to do a google search using Ruby, and print the 1st 3 results.

Could anyone point me to a sample code? I'm unable to find it.

like image 296
Dogbert Avatar asked Apr 20 '10 15:04

Dogbert


1 Answers

The gem googleajax is there for that:

require 'googleajax'
GoogleAjax.referer = "your_domain_name_here.com"
GoogleAjax::Search.web("Hello world")[:results][0...3]
like image 53
Marc-André Lafortune Avatar answered Oct 06 '22 22:10

Marc-André Lafortune