Module: GoogleSearchCriterion::Search

Extended by:
Search
Included in:
Search
Defined in:
lib/google_search_criterion/search.rb

Instance Method Summary collapse

Instance Method Details

#results(keyphrase) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/google_search_criterion/search.rb', line 7

def results(keyphrase)
  result_stats = scrape_result_stats(keyphrase)
  tokens = result_stats.split(' ')

  case tokens.first
  when "About"
    tokens[1]
  else
    tokens.first
  end.to_s.gsub(",","").to_i
end