METARs and TAFs are an ICAO abbreviated weather format. The NWS has METARs and TAFs available as text files for most airports in the world. You can easily build a METAR or TAF magnet for your web site using an xml/http request. TAFs are a little more difficult since they have multiple lines. I split my lines by finding and replacing the carriage return in the NWS text file. Before you get started you will need your ICAO Station ID. My ID is KDAN. You can look up your closest ID here.
Here is what my TAF Magnet for Danville, VA (KDAN) looks like:
Here is the .asp source code for my TAF Magnet:
<%
station = Ucase(Request.QueryString("location"))
Set jason = Server.CreateObject ("MSXML2.ServerXMLHTTP")
jason.Open "GET", "http://weather.noaa.gov/pub/data/forecasts/taf/stations/" & station & ".TXT", False
jason.Send
If jason.Status <> 200 Then
Response.Write("N/A")
Else
Response.Write("<html><head><title>TAF</title>")
Response.Write("<style>")
Response.Write("body {margin:0px; font-family:Verdana; font-size:12px; color:#" & fontcolor & ";} ")
Response.Write("table {font-size: 12px; background:#" & bcolor & "; border: 1px solid #" & bordercolor & "; padding: 2px;} ")
Response.Write("a:link {color:#" & fontcolor & "; font-size: 10px;} ")
Response.Write("a:visited {color:#" & fontcolor & "; font-size: 10px;}</style>")
Response.Write("</head><body><table><tr><td>")
tafw = jason.responseText
tafw = Replace(tafw, " ", " ")
Response.Write(Replace(tafw, vbLf, "<br>"))
Response.Write("</td></tr><tr><td><a href=""http://weather.gov/disclaimer.html""_blank"">NWS Disclaimer</a> | <a href=""http://weather4webs.com/""_top"">Weather4Webs.com</a>")
Response.Write("</td></tr></table></body></html>")
End If
Set jason = Nothing
%>

