OT: weather script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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}'




[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux