DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Wsdl The Google API (search Google With Ruby)

  • submit to reddit
        sign up to get a key first

require 'soap/wsdlDriver'
key = 'LVJnAm5QFHblahblahblah your key here'

#create driver
wsdl = ""
driver =
query = "your query string here"
start = 0
max = 10
# see
@results = driver.doGoogleSearch( key, query, start, max, true, "", true, 'lang_en', '','')
snippets = @results.resultElements.collect { |r| r.snippet } # you can get all kinds'a' info here
self.update_attribute(:html, snippets.join("\n")) # or whatever


Snippets Manager replied on Thu, 2011/03/24 - 8:34pm

hello everyone, i m new to ruby and i seen this wsdl the google api for ruby. Actually i not familiar with ruby. My aim is to get google api working in ruby. so can anyone give me the step by step procedure to do it.. Plz let me know.. Thanks in advance

Snippets Manager replied on Mon, 2012/05/07 - 1:15pm

Yeah, 1000 queries a day is still the case, I believe.

Snippets Manager replied on Mon, 2012/05/07 - 1:15pm

I tried to write a simple JSP to do this and it works very fine but I think that you have only 1000 queries per day.