sub main() ' Create a device to be used for the forecast link. ' Create a directory under html called weather. ' Go to weather.noaa.com and Select your state. Then select your city. ' Cut and paste the url into the weatherfore.txt script on line 17. ' Place weatherfore.txt into the scripts directory. ' This will place a link in a device that says Forecast and opens a new small window with the weather forecast. hs.WaitEvents dim weatherurl, forecastdev, WeatherStr dim ipos1a, ipos1, ipos2, len1 dim forecaststr, pathway, weatherpath ' Set the Following variables ' The URL to get your weather weatherurl = "/cgi-bin/iwszone?Sites=:ksz040" ' The device to store the forecast link. forecastdev = "W5" ' Get the forcast code WeatherStr = hs.GetUrl("weather.noaa.gov",weatherurl,FALSE,80) ipos1a = InStr(WeatherStr,"ZONE FORECASTS") ipos1 = InStr(ipos1a,WeatherStr,"" & vbLf & vbTab & "" & vbLf & vbTab & "" & vbLf & vbTab & vbTab & "Forecast" forecaststr = "" & vbLf & "" & vbLf & "" & vbLf & "" & vbLf & "" & vbLf & "Weather Forecast" & vbLf & "" & vbLf & "" & vbLf & "" & vbLf & vbTab & "" & vbLf & vbTab & vbTab & "" & vbLf & vbTab & "" & vbLf & "
Weather Forecast" & forecaststr & "
" & vbLf & "" & vbLf & "" ' Output the forecast to the file forecast.htm Set cffolder = CreateObject("Scripting.FileSystemObject") pathway = hs.GetAppPath weatherpath = pathway & "\html\weather\forecast.htm" Set NewFile = cffolder.CreateTextFile(weatherpath, TRUE) NewFile.WriteLine forecaststr NewFile.Close end sub