Weather4Webs.com Logo
 Free Weather and Weather Source Code For Web Sites

Home Current Forecasts Radar Images Other Aviation Source Blog About
 

Build a Current Conditions Magnet

 
Font Color
Background Color
Border Color
Station* 
 
*You need to know your ICAO Station ID.
 

Current Weather Tips, Tricks, and Fine Print

  1. This is basic data and not for navigation. Data may not be reliable. In other words no one should depend their life on this data. If you are going to use it on your web site you should disclaim the data.
  2. The current conditions magnets call my function in a iFrame which "gets" the xml file from NWS using xmlhttp and then parses it using Javascript. The best way to display current conditions is to utilize the xml file yourself directly. The current observations xml file is straight forward and easy to transfrom. The file is located at http://www.weather.gov/data/current_obs/(your station).xml. Here is a sample xsl file.
  3. If you do not know how to parse xml then the second best way would be to link to my file instead of using the iFrame code above. Create your own page or iFrame with it, this will give you a little more flexability. The nice thing about the iFrame is that if the NWS or my server is having a problem the rest of your web page will still load. The file is http://weather4webs.com/current/station.asp?station=(your station)&bgcolor=(your color)&bordercolor=(your color)&fontcolor=(your color)
  4. Source code for "getting" the xml is available at http://www.weather4webs.com/code/current_source.html.
  5. Feel free to use this data for your website however data not for re-sale.