Iom att det inte är mitt script så vet jag inte riktigt men här är det iaf i sin helhet:
' ExtendedWeather, (C) By Ronnie 2002
' This script is a modification of various other weather scripts,
' as usual I took it to new heights!
' I dont know if the weather symbol font is copyrighted or not!!! use with care!
City = "malmo, sweden" ' Set this to your city, dont forget the format "city, country".
Celcius = true ' If you want the degrees in celcius or farenheit.
MPH = false ' If you want the wind speed in miles or kilometer per hour.
Function Location
Location = GetHTMLValue("Forecast for ","</B>", "")
End Function
Function Symbol
dim icons
icons = array("","B","B","D","D","A","B","A","B","B","B","B","B","A","A","A","A","D","B","","","","","","","","S","","R","","R","","Q","","R","D","I","E","E","","A","A","A","R")
icon = GetHTMLValue("http://image.weather.com/web/common/wxicons/52/",".gif", "")
Symbol = icons(icon)
End Function
Function Temperature
Temperature = GetHTMLValue("<!-- insert current tempature --> <B>","°F</B>", "")
if celcius then Temperature = round((5/9)*(temperature -32))
if celcius then Temperature = Temperature & "°C" else Temperature = Temperature & "°F"
End Function
Function FeelsLikeTemp
FeelsLikeTemp = GetHTMLValue("<!-- insert feels like temp -->","°F</B>", "")
If FeelsLikeTemp <> "N/A" Then
If celcius then FeelsLikeTemp = round((5/9)*(FeelsLikeTemp -32))
If celcius then FeelsLikeTemp = FeelsLikeTemp & "°C" else FeelsLikeTemp = FeelsLikeTemp & "°F"
End If
End Function
Function Condition
Condition = GetHTMLValue("<!-- insert forecast -->","</B></TD>", "")
End Function
Function Wind
Wind = GetHTMLValue("<!-- insert wind --> ","</TD>", "")
if mph = false then
spos = instrrev(Wind, "at ")+3
chrs = instrrev(Wind, " ") - spos
speed = Mid(wind, spos, chrs)
nspeed = round(speed * 1.609344)
Wind = replace(wind, speed, nspeed)
Wind = replace(wind, "mph", "km/h")
end if
End Function
Function Humidity
Humidity = GetHTMLValue("<!-- insert humidity -->","</TD>", "")
End Function
Function Visibility
Visibility = GetHTMLValue("<!-- insert visibility -->","</TD>", "")
End Function
Function Barometer
Barometer = GetHTMLValue("<!-- insert pressure -->","</TD>", "")
End Function
Function DewPoint
DewPoint = GetHTMLValue("<!-- insert dew point -->", "°F</TD>", "")
If celcius then DewPoint = round((5/9)*(DewPoint -32))
If celcius then DewPoint = DewPoint & "°C" else DewPoint = DewPoint & "°F"
End Function
Function UV
UV = GetHTMLValue("<!-- insert UV index -->", "</TD>", "")
End Function
Function writefile()
GetURL = "http://www.weather.com/search/search?where=" + City
Dim Http
Set Http = CreateObject("Microsoft.XMLhttp")
Http.Open "GET",GetURL,False
Http.Send
HtmlResult = Http.ResponseText
Set Http = Nothing
set fs=CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("weather.tmp",true)
f.write(htmlresult)
f.close
set f=nothing
set fs=nothing
writefile = "Tempfile written"
End Function
Function GetHTMLValue(LeftBound,RightBound, htmlresult)
tp = "weather.tmp"
Set file_obj = CreateObject ("Scripting.FileSystemObject")
If (file_obj.FileExists(tp)) Then
Set file_path = file_obj.GetFile(tp) ' Creates the connection to the file
set file = file_path.OpenAsTextStream (1, -2) ' Opens the file for reading
htmlresult = file.readall
File.Close ' Closes the file
Set file_path = nothing ' Resets variable
Set file_obj = nothing ' Resets variable
HtmlStart = InStr(HtmlResult, LeftBound) + Len(LeftBound)
HtmlEnd = InStr(HtmlStart, HtmlResult, RightBound)
If HtmlStart > 0 AND HtmlEnd > 0 Then
GetHTMLValue = Replace(Mid(HtmlResult, HtmlStart, HtmlEnd - HtmlStart ), " ", " ")
Else
GetHTMLValue = "N/A"
End If
Else
GetHTMLValue = "N/A"
End If
End Function