Forum: Ruby Current Temperature (#68)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
David T. (Guest)
on 2006-03-02 00:05
(Received via mailing list)
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 !=1)?"Usage: #$0 <zip code>":
("The temperature in #$1 is #$2 degrees F."if
%r|Weather</b> for <b>(.*?)</b>.*?(\d+)&deg;F|=~
open("http://www.google.com/search?hl=en&q=temperature+#...)
(Guest)
on 2006-03-02 01:18
(Received via mailing list)
Semi-colons, that is so cheating. :-)
dave (Guest)
on 2006-03-02 10:21
(Received via mailing list)
| Semi-colons, that is so cheating

require("open-uri") && puts((ARGV.size !=1) ? "Usage: #$0 <zip code>":
("The
temperature in #$1 is #$2 degrees F." if %r|Weather</b> for
<b>(.*?)</b>.*?
(\d+)&deg;F|
=~open("http://www.google.com/search?hl=en&q=temperature+#...
f.read}))


This is without semi-colons :)


--
>here are more things in heaven and earth,
horatio, than are dreamt of in your philosophy.


 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f

 Sponsor:
 DVD vergini: acquista online a prezzi vantaggiosi!
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=4589&d=2-3
This topic is locked and can not be replied to.