<%
Option Explicit
'If you need to load the page from a remote address, the top portion will handle that
Response.Buffer = True
Dim objXMLHTTP, URL
' Create an xmlhttp object:
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
URL = "[URL unfurl="true"]http://www.srh.noaa.gov/data/forecasts/NCZ101.php?warnzone=ncz101&warncounty=ncc129"[/URL]
' Opens the connection to the remote server.
objXMLHTTP.Open "GET", URL, False
' Actually Sends the request and returns the data:
objXMLHTTP.Send
Dim pageContent
pageContent = objXMLHTTP.responseText
'Now to pull out the weather
Dim temp
Response.Write "<textarea cols=80 rows=40>" & pageContent & "</textarea>"
Dim beginTempLoc, endTempLoc, temperature
Dim nextTag
'find some unique tags to search for
beginTempLoc = InStr(pageContent,"<td class=""big"" width=""120"" align=""center"">")+len("<td class=""big"" width=""120"" align=""center"">")
'search after that first location for the F in degrees
endTempLoc = InStr(beginTempLoc,pageContent,"°F",1) + 6 'length of °F
'set a string to everything between the start and end
temperature = mid(pageContent,beginTempLoc,endTempLoc - beginTempLoc)
Dim numTemp, strWeather
'weather was listed first, lets get everything up to the nextTag
strWeather = Left(temperature,InStr(temperature,"<")-1) 'don't actually want the tag so subtract 1
numTemp = Right(temperature,len(temperature) - InStrRev(temperature,">"))
Response.Write "<br>The weather is " & strWeather & "<br>"
Response.Write "The current temperature is " & numTemp & "<br>"
%>