I have a webpage that I am currently developing and I am trying to put the weather on it. I do not want to get the reading from instruments on location but instead get the general weather from a website. I have two different things that I am working on to try and get this to work:
<%@ Language="VBScript" %>
Dim whichfile, Content, fs, thisfile
Content = ""
Set fs = Server.CreateObject("Scrip
Set thisfile = fs.OpenTextFile("http://weather.allrefer.com/washington/harrington.html
", 1, False)
Content = thisfile.readall
set thisfile = Nothing
set fs = Nothing
T1.text = content
public sub loadweather()
Dim filesys, testfile
dim html as string
Set filesys = CreateObject("Scripting.Fi
Set testfile= filesys.OpenTextFile("http://weather.allrefer.com/washington/harrington.html
", forreading, TristateUseDefault)
T1.text = testfile.readall
Nothing happens with the VBScript and the ASP says:
Microsoft VBScript runtime error '800a0034'
Bad file name or number
/tests/vbs.asp, line 15
I don't care what I end up getting to work. Putting the text into T1 is just a test to see if the text got there. When it does I will use a substring, indexof, or something like that to pick out what I need, I got that part. I would almost prefer it to be in VBScript, just because I understand it better and could probably learn more from it, but it does not matter.