Home » Development » Geektool » Weather

In order for you to be able to display the current weather, you will need to install Lynx; a free terminal based web browser. You must have this installed because you will need to be able to pull raw text (current temperature and weather conditions) from the web.

Each of the following code blocks will be entered into separate Geektool Shell Entries.

Temperature:

lynx -dump http://printer.wunderground.com/cgi-bin/findweather/getForecast?query=YOURZIPCODE | awk '/Temp/{printf $2, ": "; for (i=3; i<=3; i++) printf $i " " }'

Conditions:

lynx -dump http://printer.wunderground.com/cgi-bin/findweather/getForecast?query=YOURZIPCODE | awk '/Conditions/ && !/Forecast/ {for (i=2; i<=10; i++) printf $i " "}'

If you find your conditions resulting in something with letters cut off, change the 100 to a value higher.

Respond

You must be logged in to post a comment.