Geektool Weather

Geektool is an OSX system preference module that allows you to display information on your desktop. You can display shell, file or image output. I have used this prefpane to display load averages and process data in the past but now I just have it displaying weather info. Its handy for early morning or when a cold spell comes around. Give it a try if you use OSX and think you may have some data you would like to display on your desktop. An Expose Desktop corner and Geektool work nicely together for on the fly info.

Screen shot 2010-05-26 at 7.01.08 PM

And the code. You’ll need lynx to make this work. Replace 32828 with your zip code. Leave me a comment with your geektool scripts if you give it a try.

lynx -dump 'http://m.wund.com/cgi-bin/findweather/getForecast?brand=mobile&query=32828' | grep 'Temperature' | cut -c 16-21
lynx -dump 'http://m.wund.com/cgi-bin/findweather/getForecast?brand=mobile&query=32828' | grep -m 1 Conditions | awk '{print $2}'
lynx -dump 'http://m.wund.com/cgi-bin/findweather/getForecast?brand=mobile&query=32828' | grep -m 1 Observed | awk '{print $5 " "$6}'
lynx -dump 'http://m.wund.com/cgi-bin/findweather/getForecast?brand=mobile&query=32828' | grep -m 1 Updated | awk '{print $2 $3" " $4" " $5 " "$6" " $7" " $8 $9}'

  • Joe

    one http query:

    IFS=$’\n’
    a=`lynx -dump ‘http://m.wund.com/cgi-bin/findweather/getForecast?brand=mobile&query=21793’`
    for i in $a;
    do
    echo $i | grep ‘Temperature’| awk ‘{print $2}’
    done
    for i in $a;
    do
    echo $i | grep -v “\[” | grep -m 1 Conditions | awk ‘{print $2}’
    done
    for i in $a;
    do
    echo $i | grep -m 1 Observed | awk ‘{print $4 ” “$5}’
    done
    for i in $a;
    do
    echo $i | grep -m 1 Updated | awk ‘{print $2 $3″ ” $4″ ” $5 ” “$6″ ” $7″ ” $8 $9}’
    done