I travel by train to work. However the train often don't run because of some defect. If this happens i have the choice of having 1h to 1.5h extra travel time or go back home (15Km) and work from home.
<b>Solution</b>
Just before i wake up HS will get the webpage and parse it for a keyword. If this keyword is found then take some actions to notify me.
Code: Select all
'Usage:
'
'get_html <URL>, <Text to search for>
'Example : Get_HTML "http://www.ns.nl/storingen/index.form", "storing rounded"
'
'Remark : Search text is not case sensitive
Public Sub Main(ByVal Parms As String)
Get_HTML("http://www.ns.nl/storingen/index.form", "storing rounded")
End Sub
Sub Get_HTML (up_http, SearchString)
dim xmlhttp
xmlhttp = createobject("msxml2.xmlhttp.3.0")
xmlhttp.open("get", up_http, false)
xmlhttp.send
if(instr(Ucase(xmlhttp.responseText), Ucase(SearchString))) then DoActions()
xmlhttp = nothing
End Sub
Sub DoActions()
'<-- Do actions here -->
'Turn ON the Audrey in the living room and OFF after 30 mins.
hs.ExecX10("K6", "ON")
hs.WaitSecs(120)
hs.GetURL("192.168.55.51","/led.shtml?t2m2",TRUE,80)
hs.WaitSecs(1800)
hs.ExecX10("K6", "OFF")
'<-- End of actions -->
End Sub