Friday, November 7, 2008

How's the Weather up there? CLI weather app.

weather-util gives you local weather readings on the command line. If you are running Ubuntu you can easily install this handy little application by typing the following in the command line.

$apt-get install weather-util
To retrieve local weather information you will need to know your local weather id which can be found at the National Weather Service. Your id is a 4 digit letter code which identifies your city or area. I live in Salt Lake City, Utah and my id is KSLC.

Once you have your id the syntax is fairly straight forward.

$weather -id=KSLC
Which outputs the following:

Current conditions at UT (KSLC)
Last updated Nov 07, 2008 - 09:53 AM EST / 2008.11.07 1453 UTC
Wind: from the SE (140 degrees) at 8 MPH (7 KT)
Sky conditions: mostly cloudy
Temperature: 39.9 F (4.4 C)
Relative Humidity: 62%

You can get a forecast using the -f option.

Current conditions at UT (KSLC)
Last updated Nov 20, 2008 - 08:53 AM EST / 2008.11.20 1353 UTC
Wind: Calm
Sky conditions: partly cloudy
Temperature: 32.0 F (0.0 C)
Relative Humidity: 85%
Issued Thursday morning - Nov 20, 2008
Thursday... Sunny, high 55, 0% chance of precipitation.
Thursday night... Low 30, 10% chance of precipitation.
Friday... Sunny, high 43, 0% chance of precipitation.
Friday night... Low 21.
Saturday... High 45.


Now you have no excuse to be caught out in the cold unprepared. If you can muster up some creative juices I'm sure you could easily get the output to display in conky.

No comments: