Code: Select all
## May 2006 - Added 'Observed at' 'Dew Point' 'Barometer' and 'Moonrise/set' data.
## - Fixed various bugs, removed various redundant code, tabinated script..
## May 20 2006 - Wunderground changed "Observed At" to "Observed at" doh... Fixed script.
##
## May 21 2006 - Added "Wind Gust" and "Barometer Rising/Falling" data.
## Tweaked the display output..
## - Added Lat/Lon by request.
## - Added US Storm Advisories/Warnings.
## - Added Elevation
## - Added Snow depth
## - Fixed "Nowcast"
## - Fixed "Windchill"
## - Changed Forecast output.
## - Put in a var to use an IP (or hostname if prefered) to connect
## to wunderground.com because my ISP's dns sucks :P
## May 22 2006 - More bugfixes..Kick an error to non-us locales trying to
## get precip/record data, no sense lagging them to [censored]
## just to find out after opening the socket the data is only for
## the US.
## Ohh, and close the damn socket on returning errors in the
## precip code...
## - Added record high/low temp data as a switch (.wz -r) and as
## '.wz record' and as a configurable default with
## 'set wz_default_rec'
## May 24 2006 - Fixed -u so it properly returns the bad syntax error msg.
## - Added length of day data, since some locations don't have
## sunrise/sunset (eg, barrow, alaska)
## - Fixed '$location' with 'string trim' cos it was choking on empty spaces :P
## - Added '.wz -d remove' to allow user to unset a default city.
## - Made a test page with ALL data elements for testing :P
## - Fixed regexp parsing of unusual moon html format after moonset
##
## Todo:
## - Complete re-write for efficiency :P
## It would presumably be much faster to grab the url, then work on the
## contents in memory, instead of repeatedly pulling the data off the socket.
## So, porting it to use the tcl-http package would probably be better..
## - Remove *unnecessary* foreign country code...
## wunderground *does* allow searching for 'city country'
## Get rid of requiring a comma for city, state for US locales, as well.
## And get rid of requiring US state abbreviations.
## This will be fixed when I port the script to tcl-http.