YWCLI 0.1.0

Yahoo! Weather Command Line Interface

YWCLI is a little terminal application which gets weather information from Yahoo! and shows it. You can just run it as ‘ywcli.rb’ and get current weather conditions for the default location; or you can specify a day with the –day [number] option (where number is in the range of 0..5); or you can make it show all available information with the –all switch; and last (but not least!) you can specify your own format string, which can be a very convenient way to use this program inside scripts.

These are all available command line options: [-a, –all] Shows all available informations. [-d [day], –day [day]] Shows weather information for the specified day. 0:: Current weather observation. 1:: Today’s forecast. 2-5:: Tomorrow’s forecast, and so on. [-w [woeid], –woeid [woeid]] Sets location by woeid (check weather.yahoo.com to find your own). [-u [units], –units [units]] Sets units (metric/english).

-f [format], –format [format]

Sets output format string. This can be any string including zero or more format tags (see below).

[-h, –help] Help screen. [-v, –version] Version and author information.

And here is a list of all format tags you can use. All tags are one-char long, where a trailing ‘n’ appears, it must be intended as a number indicating the day(0..5).

Basic

%tn:: Text description. %T:: Current temperature. %ln:: Low forecast temperature. %hn:: High forecast temperature. %cn:: Current condition code. %dn:: Date/Time of observation/forecast.

Location

%L:: Observed location. %a:: Latitude of observed location. %b:: Longitude of observed location. %r:: Region name. %C:: Country name.

Units

%U:: Temperature units. %D:: Distance units. %p:: Pressure units. %s:: Speed units.

Wind/Pressure/Humidity

%W:: Wind chill. %e:: Wind direction. %S:: Wind speed. %H:: Humidity. %v:: Visibility. %P:: Pressure. %R:: Barometer status (0 steady, 1 rising, 2 falling).

Astronomy

%f:: Sunrise time. %g:: Sunset time.

Hope you like it :)