Home |
Search |
Today's Posts |
![]() |
|
alt.talk.weather (General Weather Talk) (alt.talk.weather) A general forum for discussion of the weather. |
Reply |
|
LinkBack | Thread Tools | Display Modes |
#1
![]() |
|||
|
|||
![]()
Hi,
I wrote a simple script to obtain weather forecast from a Bash terminal. It is listed below. The problem with this script is that it is not portable. A user needs to edit it to make it work for his geographical location. The script obtains its information from "National Weather Service", zone forecasts. For instance the url for columbus, ohio is http://www.erh.noaa.gov/displayprod....duct=ILNZFPILN Would you know how I may generate this url know the user's zip code or city/state. I mean how can zipcode information be translated to the weather zone (ILNZFPILN in the above example). Is there a directory of these somewhere. regards b thomas ------------------------------------------------------------- #!/bin/sh # forecast - Reports forecast on weather conditions. # URL must be set to the appropriate value for user # Also the first multiline sed match string will need # to be modified (How can this be automated ?) # For Columbus, Ohio URL="http://www.erh.noaa.gov/displayprod.php?product=ILNZFPILN" USAGE="usage: radar [-s filename] -s save forecast as -h show this message" while getopts ":sh" opt do case $opt in s ) SAVE=true; FILENAME=$OPTARG;; h|\?) echo "$USAGE" exit 0 ;; esac done # Scripts has no arguments, this is just for future use USEDARGS=`expr $OPTIND - 1` shift $USEDARGS ARGS="$*" lynx -dump "$URL" | \ sed -n '/OHZ045-046-054/,/\$\$/p' |\ sed -e 's/\.\.\./\n/' |\ sed -e 's/^\./\n/' |\ sed -e 's/\.\.\.$//' |\ sed -e 's/\.\.\./\n/g' | less exit 0 |
#2
![]() |
|||
|
|||
![]()
On Mon, 12 Dec 2005 09:12:57 GMT, B Thomas
wrote: Would you know how I may generate this url know the user's zip code or city/state. I mean how can zipcode information be translated to the weather zone (ILNZFPILN in the above example). Is there a directory of these somewhere. regards b thomas I know from nothing about scripts. However, will this fill the bill? http://www.erh.noaa.gov/ifps/MapClic...te=OH&site=ILN As you can see at the top of the map, you can put in any zip and get a forecast for a specific place, anywhere in the country. I don't think you could get the whole zone, because each zone would contain many zip codes. Please also check the "Addition forecasts and information" section if you want a different format. You will also note, toward the top on the left, that there is a hot link to NWS WIlmington. They should have a "Contact Us" section. I would message or call their computer guy. I talk to/email the NWS for my area a lot. HTH Roy National/International News Guy www.VirginiaNewsSource.com Teach a man to fish and you feed him for a lifetime |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you obtain your advance notice of aurora displays? | uk.sci.weather (UK Weather) | |||
OT but - TV Weather Station - weather forecast system outputs to your 56 inch screen | uk.sci.weather (UK Weather) | |||
radar script | uk.sci.weather (UK Weather) | |||
Synoptic charts (what I have managed to obtain so far) | uk.sci.weather (UK Weather) | |||
O/T Java Script niggle. | uk.sci.weather (UK Weather) |