OT: weather script

Christopher Moore christopher.h.moore at verizon.net
Fri Aug 22 12:22:43 EDT 2003


Hello,
I improvised on Keith Wanton's idea for using lynx to retrieve the weather.
The following script is very simple, but it gave me a chance to learn
something about awk.  I named it wx and type
wx <zipcode> to obtain the current weather.  It should work great with
speakup except I need to figure out how to remove the degree symbol from
the temp and dew point.

Enjoy!

##### wx xcript below this line #####
#!/bin/sh
#  The following script uses lynx to retrieve the 
#  weather for the entered zipcode.
#  A simple awk program selects the fields to be displayed.
lynx -dump http://braille.wunderground.com/cgi-bin/findweather/getForecast?query=$1 $2|\
awk ' \
/Observed/ {print $1 " " $2 " " $3 " " $4}
/Temperature/ {print $1 " " $2}
/Humidity/ {print $1 " " $2} 
/Dew Point/ {print $1 " " $2 " " $3}
/Wind/ {print $1 " " $2 " " $3 " " $4}'




More information about the Speakup mailing list