0923デフォルトの名無しさん
2017/12/28(木) 07:10:57.10ID:s+AqweGprequire 'open-uri'
expr = "the Answer to the Ultimate Question of Life, the Universe, and Everything"
uri = "https://www.google.com/complete/search?output=toolbar&q=%s"
puts open(format(uri, expr.gsub(' ', '%20'))).string[/data="\K[^"]*/]
#=> 42