rendered paste body ' Clear Sky Clock Gadget
' (c) 2007 Zack Panitzke
'url = "http://cleardarksky.com/txtc/RchstrHYcsp.txt"
'tempFileLoc = "C:\Users\Zack\AppData\Local\Microsoft\Windows Sidebar\Gadgets\ClearSkyClock.gadget\temp.dat"
'currentClockText = ""
'Sub getClock
'retrieveClockTextFromWeb()
'text.innerText = "Clock retrieved from web"
'If retrieveClockTextFromFile() Then
' text.innerText = "Clock retrieved from file"
'Else
' If retrieveClockTextFromWeb() Then
' text.innerText = "Clock retrieved from web"
' Else
' text.innerText = "Clock not retrieved"
' End If
'End If
'End Sub
'Function retrieveClockTextFromFile As boolean
' Dim objFSO, returnVal
' Set objFSO = Createobject( "Scripting.FileSystemObject" )
' If objFSO.Fileexists( tempFileLoc ) Then
' Dim clockTextFile
' Set clockTextFile = objFSO.OpenTextFile( tempFileLoc, ForReading )
' currentClockText = clockTextFile.readAll()
' clockTextFile.close()
' returnVal = True
' Else
' returnVal = False
' End If
' Set objFSO = Nothing
' return returnVal
'End Function
Function RetrieveClockTextFromWeb() As Boolean
'Dim objXMLHTTP
Msgbox "HERE"
RetrieveClockTextFromWeb = False
'Set objXMLHTTP = CreateObject( "MSXML2.XMLHTTP" )
'objXMLHTTP.open "GET", url, false
'objXMLHTTP.send()
'If objXMLHTTP.Status = 200 Then
' Dim responseString, objFSO, clockTextFile
' currentClockText = objXMLHTTP.ResponseText
' Set objFSO = Createobject( "Scripting.FileSystemObject" )
' If objFSO.Fileexists( tempFileLoc ) Then objFSO.DeleteFile( tempFileLoc )
' Set clockTextFile = objFSO.CreateTextFile( tempFileLoc, True )
' clockTextFile.write( currentClockText )
' clockTextFile.close()
' Set objFSO = Nothing
' returnVal = True
'End If
'Set objXMLHTTP = Nothing
End Function
Sub TestSub
Dim test As Boolean
test = RetrieveClockTextFromWeb
text.innerText = test
End Sub