Show a one-line weather forecast on the desktop
Nov 18, '08 07:30:00AM
Contributed by: Anonymous
I love Wunderground.com's forecast. You can read all of the numbers, and look at radar all you want, but 95% of the time, it's too much info. Wunderground has a one-line forecast that relates today or tomorrow's temperature to today's. "Today is forecast to be colder than yesterday" is all I need to know.
Once you've installed GeekTool, you'll also need Lynx, a popular text web browser. Once GeekTool and lynx are installed, create a new shell entry in GeekTool and enter this code, substituting in your zip code for 12345:
lynx -dump http://www.wunderground.com/cgi-bin/findweather/getForecast?query=12345|awk '/Tomorrow is/'
This will tell Lynx to go retrieve the Wunderground site and cut out every line that dosn't start with "Tomorrow is." Of course, if you check the weather in the morning, you'll need to change it to "Today is." Either way, the GeekTool entry will disappear when that text is not present. I guess you could have the weather appear in different places on your desktop depending on wether it's forecasting today or tomorrow, but that's left as an exercise to the reader.
[robg adds: I tried this, and it works as described. It's probably possible with curl instead of lynx, but you'd then need to do more parsing of the output to strip out the HTML characters. Given this data probably won't change during the day, you should set the GeekTool refresh to a really large value.]
Comments (18)
Mac OS X Hints
http://hints.macworld.com/article.php?story=200811121622431