extended forecast
[1/2] from: ryan::christiansen::intellisol::com at: 7-May-2001 14:02
I fixed the parsing in 'forecast so that it will give you the extended
weather forecast, as well...
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
]
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]
[2/2] from: ralph:abooks at: 7-May-2001 15:33
Very nice, Ryan (I love weather scripts). Here's a modification of your
script to make it web-ready. See it in action doing the Asheville, NC
weather at:
http://nuoj.com/cgi-bin/weather-forecast.r
and below is the script itself (mostly Ryan's work, give him all the
credit<g>):
#!/rebol/rebol --cgi
REBOL []
print "Content-Type: text/html^/"
ZIP: 28806 ;;; put in your own zip code
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)]
print future-weather ;; added print function
]
print "<h2>Weather for Asheville, North Carolina</h2><br>"
forecast ZIP