Google can help! Just search the two terms in Google and see which query gives you more results. There are two issues:
- The first is fairly obvious: you need to add quotes to the terms you're searching. Otherwise, you won't be searching for exact matches.
- Google often re-writes your query and show those results instead of your original. To disallow this, add nfpr=1 to the search URL.
Enjoy!#!/usr/bin/ruby
require 'net/http'
require 'uri'
require 'cgi'
NUM_RESULTS_REGEX = /#{"<p id=resultStats> Results"+
" <b>\\d+<\/b> - <b>\\d+<\/b>"+
" of about <b>([\\d,]+)<\/b> for <b>"}/
SEARCH_URL = "http://www.google.com/search?nfpr=1&q="
if ARGV.size != 2
$stderr.puts "Usage: ./which_usage.rb \"term 1\" \"term 2\""
exit(1)
end
ARGV.each { |q|
puts %Q{"#{q}": #{
(Net::HTTP.get URI.parse(
SEARCH_URL+CGI.escape(%Q{"#{q}"})
)).scan(NUM_RESULTS_REGEX).first.first} results.}
}