Which is better - Emacs or Vim? (Google fight) Greetings, noble code golfers. Today you will resolve the most ancient and distinguished of debates - Emacs or Vim?

Your challenge is to take two search terms as input, and output which of those terms has the most Google search results. (This is obviously completely fair. What do you mean, biased?)

Here are some example inputs and outputs:

Input: emacs and vim
Output: vim (totally not creating any flamewars in the comments)

Input: google and microsoft
Output: google

Input: code golf stack exchange and code review stack exchange
Output: code golf stack exchange (yeah!)

And here are some edge cases just for fun (and for testing your solutions):

Input: About 1,000,000 results and About 100,000 results
Output: About 100,000 results

Input: This will autocotrect and Another testcase
Output: Another testcase (if you don't consider autocorrecting, then the first one will win)

For the following test cases, you must remove the # signs in the search terms first, since they rely on the term having a specific amount of results and posting the term here would ruin that.

Input: Thissear#chter#mhasno#results and Another testcase
Output: Another testcase (just a test for zero results)

Input: "These exact wo#rds do#n't exi#st# on the Internet" and Another testcase
Output: Another testcase (testing "s)

Input: Abo#ut 1,65#2,85#3,2#86 re#sults and Another testcase
Output: Another testcase (this one is tricky - the above search term has one result)

Input: "Abo#ut 4#8,234,8#75,14#7 res#ults" and Another testcase
Output: Another testcase (also tricky - no results, so it displays the search term)

You don't need to handle the corner-case of "quoted" searches returning "No results, showing results without quotes instead" because that would just be too complicated. You don't need to handle inputs with the same number of results either.

This is code-golf, so the shortest code in bytes will win!
Ruby, 203 180 bytes

-&gt;*s{s.map{|x|[(open("http://www.google.com/search?nord=1&amp;q=#{URI.escape x}&amp;nfpr=1").read.match(/s"&gt;(About )?([\d,]+) result/)||[?0])[-1].split(?,).join.to_i,x]}.max[1]}


+11 bytes for the -ropen-uri flag (plus space).

Input is taken as two arguments.

URL explanation:


?nord=1: prevent auto-redirect from HTTP to HTTPS
&amp;q=#{URI.escape x}: escape the query so "s work
&amp;nfpr=1: no autocorrect


The whole map turns ['emacs','vim'] into [[2150000, 'emacs'], [14900000, 'vim']]. (You can see this by changing the .max[1] at the end to .inspect.) Then, the max is taken, which will grab the one with the most results, and [1] is used to get the search term.