alt.talk.weather (General Weather Talk) (alt.talk.weather) A general forum for discussion of the weather.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old December 12th 05, 09:12 AM posted to alt.talk.weather
external usenet poster
 
First recorded activity by Weather-Banter: Dec 2005
Posts: 1
Default Script to obtain weather forecast

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   Report Post  
Old December 12th 05, 02:24 PM posted to alt.talk.weather
external usenet poster
 
First recorded activity by Weather-Banter: Aug 2005
Posts: 11
Default Script to obtain weather forecast

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you obtain your advance notice of aurora displays? Richard[_4_] uk.sci.weather (UK Weather) 8 September 29th 13 10:18 PM
OT but - TV Weather Station - weather forecast system outputs to your 56 inch screen [email protected] uk.sci.weather (UK Weather) 1 November 5th 07 10:13 PM
radar script James Brown uk.sci.weather (UK Weather) 2 November 30th 06 10:45 PM
Synoptic charts (what I have managed to obtain so far) Gavin Staples uk.sci.weather (UK Weather) 27 May 22nd 05 10:53 AM
O/T Java Script niggle. keith.r.harris uk.sci.weather (UK Weather) 7 October 20th 04 11:30 PM


All times are GMT. The time now is 12:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Weather Banter.
The comments are property of their posters.
 

About Us

"It's about Weather"

 

Copyright © 2017