Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Show a one-line weather forecast on the desktop' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Show a one-line weather forecast on the desktop
Authored by: rammjet on Nov 18, '08 09:45:40AM
Using curl:
curl -s http://www.wunderground.com/cgi-bin/findweather/getForecast?query=12345 | awk '/Today is/ || /Tomorrow is/' | textutil -convert txt -stdin -stdout -format htm
'textutil' converts the 'html' output to 'text'.   It is a very versatile command.

Modifying the 'awk' command allows it to handle both 'Today' and 'Tomorrow' conditions

Both 'curl' and 'textutil' are included with Mac OS X

[ Reply to This | # ]

Show a one-line weather forecast on the desktop
Authored by: Anonymous on Nov 18, '08 11:30:00AM

-format html, not -format htm -- the latter kicks back "invalid input format".



[ Reply to This | # ]
Show a one-line weather forecast on the desktop
Authored by: rammjet on Nov 19, '08 09:40:38AM
Yes, sorry, it was a typo. The "l" in "html" must have gotten dropped while playing around with formatting.   klaus has displayed it correctly along with piping it to growl.

[ Reply to This | # ]
Show a one-line weather forecast on the desktop
Authored by: kopf on Nov 18, '08 08:35:19PM
If you have Growl and growlnotify installed try this, adapted from above: curl -s http://www.wunderground.com/cgi-bin/findweather/getForecast?query=12345 | awk '/Today is/ || /Tomorrow is/' | textutil -convert txt -stdin -stdout -format html | growlnotify

[ Reply to This | # ]
Show a one-line weather forecast on the desktop
Authored by: codeProle on Nov 20, '08 05:35:28AM

When I run the script (with 'html') all I get is "Error reading -stdin"

I've tried typing the script myself and copy-pasting it into Terminal.

Help!



---
--
15" G4 TiBook 867MHz 768 MB 100 GB .:. 10.4.4



[ Reply to This | # ]