[REBOL] forecast
From: ryan::christiansen::intellisol::com at: 7-May-2001 13:53
I thought I'd share this quick function for any web developers who may be
interested in grabbing National Weather Service (U.S.) forecasts from
Accuweather.com.
forecast: func [
ZIP [integer!] {The ZIP code for where you want the forecast}
/local weather-URL weather-info future-weather
][
weather-URL: make url! rejoin
[{http://www.accuweather.com/adcbin/local_index?thisZip=} ZIP {&nav=home}]
weather-info: read weather-URL
parse/all weather-info [thru "^/." copy text to "^/^/" (future-weather:
copy text)]
future-weather
]
USAGE example...
>> print forecast 98270
connecting to: www.accuweather.com
THIS AFTERNOON...MOSTLY SUNNY THEN INCREASING CLOUDS. HIGHS IN THE
60S. WIND LIGHT AND VARIABLE...BECOMING SOUTHWEST 5 TO 10 MPH LATE.
.TONIGHT...CLOUDY. A CHANCE OF LIGHT RAIN OR DRIZZLE. LOWS AROUND 45.
WIND SOUTHWEST 10 TO 15 MPH EXCEPT NORTHWEST TO 10 MPH NORTH OF
SEATTLE.
.TUESDAY...MOSTLY CLOUDY WITH SPRINKLES OR DRIZZLE MAINLY IN THE
MORNING. HIGHS 55 TO 60. SOUTHWEST WIND 10 TO 15 MPH BECOMING
NORTHWEST 5 TO 15 MPH LATE.
.< TEMPERATURE / PRECIPITATION
SEATTLE 65 45 59 / 10 30 20
EVERETT 62 45 58 / 10 40 30
SHELTON 67 45 60 / 10 20 20
>>
Ryan C. Christiansen
Web Developer
Intellisol International
4733 Amber Valley Parkway
Fargo, ND 58104
701-235-3390 ext. 6671
FAX: 701-235-9940
http://www.intellisol.com
Global Leader in People Performance Software
_____________________________________
Confidentiality Notice
This message may contain privileged and confidential information. If you
think, for any reason, that this message may have been addressed to you in
error, you must not disseminate, copy or take any action in reliance on it,
and we would ask you to notify us immediately by return email to
[ryan--christiansen--intellisol--com]