D
David Tran
My one-line solution.
Just join the below 4 lines become one single line; even no need space
when join lines.
require'open-uri';puts (ARGV.size !=3D1)?"Usage: #$0 <zip code>":
("The temperature in #$1 is #$2 degrees F."if
%r|Weather</b> for <b>(.*?)</b>.*?(\d+)°F|=3D~
open("http://www.google.com/search?hl=3Den&q=3Dtemperature+#{ARGV[0]}"){|f|=
f.read})
Just join the below 4 lines become one single line; even no need space
when join lines.
require'open-uri';puts (ARGV.size !=3D1)?"Usage: #$0 <zip code>":
("The temperature in #$1 is #$2 degrees F."if
%r|Weather</b> for <b>(.*?)</b>.*?(\d+)°F|=3D~
open("http://www.google.com/search?hl=3Den&q=3Dtemperature+#{ARGV[0]}"){|f|=
f.read})