Skip to content

"Yweather" Puts the Weather On Your OS X Desktop

May 20, 2009


Mac OS X only: Reader Daniel used his ubergeeky perl skills combined with GeekTool and created a more powerful way to display the current weather conditions on his desktop.

Unlike the previous weather-on-the-desktop method we’ve covered, Daniel’s script extracts the current weather information from Yahoo’s feeds, caches it locally, and allows you to use each piece of data separately—it even grabs the current weather image and caches it locally so you can include it on your desktop.

Daniel explained how his script works, and how he includes the information on his desktop:

I wrote a a perl script that pulls the xml from the rss feed and caches it locally and extracts the information from the local version. A parameter is included to update the local cache. In addition it also pulls the images from the main yahoo weather page that represents the weather, not the ones in the rss feed and caches them locally.

The scripts I use to display my weather in geektool are as follows, for the forecast I use 4 scripts:

echo `yweather -fd1` " - " `yweather -ft1`
echo "H: " `yweather -fh1` " L: " `yweather -fl1`
echo `yweather -fd2` " - " `yweather -ft2`
echo "H: " `yweather -fh2` " L: " `yweather -fl2`

The current temperature and description:

yweather -ct
yweather -cw

And I have the update command set to run every 30 minutes:

yweather --update && yweather --copyimage

You can grab the script for yourself at the link below, or check out how to put news on your desktop with GeekTool. If that’s not enough, learn how to monitor your Mac and more, or even add a desktop calendar to your wallpaper. Great work, Daniel!

Got your own ubergeeky, hacked together, and totally awesome productivity tricks? We’d love to hear about them! Send an email to tips [at] lifehacker.com with “ubergeek” in the subject line, and we may just feature them here.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: