Put Current Weather Conditions on Your Desktop with GeekTool

Status
Not open for further replies.

Osiris

Golden Master
Messages
36,817
Location
Kentucky
Mac OS X only: Reader Rodolfo Novak posts a useful script to add the current weather conditions to your Mac desktop using the GeekTool desktop overlay.
The script is nothing more than a bunch of *nix commands chained together to pull down the weather from Yahoo and output only the current conditions to the console—meaning that you can run this script anywhere with access to the Bash shell and common tools, including previously mentioned Cygwin on Windows.

To make this really useful and display it on your desktop, you can add the following as a shell script in GeekTool, replacing the YOURCITYCODE text with the actual code from Yahoo's weather feed.
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=YOURCITYCODE&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'

Hit the link for the example of how to get the code from the Yahoo URL. Be sure to also check out how to using GeekTool embed a desktop calendar, or see our feature on monitoring your Mac and more with GeekTool.


GeekTool: Put Current Weather Conditions on Your Desktop with GeekTool
 
Status
Not open for further replies.
Back
Top Bottom