'汾V1.0
'by ten
On Error Resume Next
Set Sh = CreateObject("Wscript.Shell")
Set xmlh = CreateObject("msxml2.xmlhttp")
Set Fso = Createobject("Scripting.FileSystemObject")
if Not Fso.FileExists("C:\TB.Txt") Then
Set txt = Fso.CreateTextFile("C:\TB.Txt")
txt.writeline "[C1009ͨ]:"
txt.close
Set txt=nothing
End if
i = 1
j = 0
b = ""
op = True
Set txt = Fso.OpenTextFile("C:\TB.Txt",1)
kb = txt.readall
Txt.close
Set txt=nothing
Do
WScript.Sleep 3000
xmlh.open "GET","http://61.187.64.231/index.aspx?pkId=3379",False
xmlh.send
If Err.Number<>0 Then '=-2146697211 Then
WScript.Sleep 1000*60
Sh.Run Chr(34) & Wscript.ScriptFullName & Chr(34)
Exit Do
End If
x = xmlh.responseText
b = "[C1009ͨ]:"
While j<7
j = j+1
c = instr(i,x," ",""),vbcrlf,"")<>"[C1009ͨ]:" then
s=msgbox("ͨи£" & vbcrlf & b & vbcrlf & "鿴",vbYesNo)
Set txt = Fso.CreateTextFile("C:\TB.Txt")
txt.write b
txt.close
Set txt=nothing
kb=b
if s=vbyes then createobject("wscript.shell").run "http://61.187.64.231/index.aspx?pkId=3379"
End if
wscript.sleep 1000*30
If op=true Then op=False:Msgbox Weather(),64,"A"
Loop
Function Weather()
xmlh.open "GET","http://www.baidu.com/s?wd=%CC%EC%C6%F8&f=12&rsp=0&oq=tianqi&tn=baiduhome_pg",False
xmlh.send
html = xmlh.responseText
str_temp = "</a></div><strong altemp_special" & Chr(34) & ">"
a = InStr(html,str_temp) + Len(str_temp)
b = InStr(a,html,"</strong><br><strong>")
c = b + Len("</strong><br><strong>")
d = InStr(c,html,"</strong><br><span>")
Today_Temp = Mid(html,a,b - a)
Today_Weather = Mid(html,c,d - c)
Today_Wind = Mid(html,d + Len("</strong><br><span>"),InStr(d,html,"</span></td>") - (d + Len("</strong><br><span>")))
a = InStr(d,html,"</a></div>") + Len("</a></div>")
b = InStr(a,html,"<br>")
c = InStr(b + 4,html,"<br><span>")
Tomorrow_Weather = Mid(html,b + 4,c - b - 4)
Tomorrow_Temp = Mid(html,a,b - a)
Tomorrow_Wind = Mid(html,c + Len("<br><span>"),InStr(c,html,"</span></td>") - (c + Len("<br><span>")))
a = InStr(c,html,"</a></div>") + Len("</a></div>")
b = InStr(a,html,"<br>")
c = InStr(b + 4,html,"<br><span>")
the_weather = Mid(html,b + 4,c - b - 4)
the_Temp = Mid(html,a,b - a)
The_Wind = Mid(html,c + Len("<br><span>"),InStr(c,html,"</span></td>") - (c + Len("<br><span>")))
Line1 = "A"
Line2 = "" & today_temp & "," & today_weather & "," & today_wind
Line3 = "" & tomorrow_temp & "," & tomorrow_weather & "," & tomorrow_wind
Line4 = "" & the_temp & "," & the_weather & "," & the_wind
Weather = line1 & vbCrLf & line2 & vbCrLf & line3 & vbCrLf & line4
End Function
''''''''''''''''''''''''''''''''''''''aY''''''''''''''''''''''''''''''''''''''