Weather reports via XML

From Wildsong
Revision as of 18:47, 3 December 2005 by Brian Wilson (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

You can get regional information in a nice web format from http://www.nws.noaa.gov/ but if you want to insert just the information you want into a web page, you can grab the XML data and parse that. They can provide you with tabular data if you don't want to do any programming.

Visit the NWS web site, click on the map to find the area of interest,

Click on "New products" and you will get a form to fill out to select your area and the parameters you want for your feed. Here is the URL that it gave me:

http://ifps.wrh.noaa.gov/cgi-bin/dwf?outFormat=xml&duration=72hr&interval=6&citylist=CORVALLIS%2C44.5710%2C-123.2760&city=Go&latitude=&longitude=&ZOOMLEVEL=1&XSTART=&YSTART=&XC=&YC=&X=&Y=&siteID=PQR

After thinking for a bit I realize that there is no need to do "programming", all I need to do is create a style sheet and insert the code into the page in an iframe:

Here is the iframe code for my location:

<iframe name="Corvallis weather" src="http://ifps.wrh.noaa.gov/cgi-bin/dwf?outFormat=xml&duration=72hr&interval=6&citylist=CORVALLIS%2C44.5710%2C-123.2760&city=Go&latitude=&longitude=&ZOOMLEVEL=1&XSTART=&YSTART=&XC=&YC=&X=&Y=&siteID=PQR" scrolling=no width=480>

Without the stylesheet it will look like this:
<html> <iframe name="Corvallis weather" src="http://ifps.wrh.noaa.gov/cgi-bin/dwf?outFormat=xml&duration=72hr&interval=6&citylist=CORVALLIS%2C44.5710%2C-123.2760&city=Go&latitude=&longitude=&ZOOMLEVEL=1&XSTART=&YSTART=&XC=&YC=&X=&Y=&siteID=PQR" scrolling=no width=480> </iframe> </html>