|
#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_UseAnsi=y ;编码
#AutoIt3Wrapper_Icon= ;图标
#AutoIt3Wrapper_Outfile= ;输出文件名
#AutoIt3Wrapper_Outfile_Type=exe ;文件类型
#AutoIt3Wrapper_Compression=4 ;压缩等级
#AutoIt3Wrapper_UseUpx=y ;使用压缩
#AutoIt3Wrapper_Res_Comment= ;注释
#AutoIt3Wrapper_Res_Description= ;详细信息
#AutoIt3Wrapper_Res_Fileversion= ;文件版本
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p ;自动更新版本
#AutoIt3Wrapper_Res_LegalCopyright= ;版权
;#AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer% ;自定义资源段
#AutoIt3Wrapper_Run_Tidy=y ;脚本整理
#AutoIt3Wrapper_Run_Obfuscator=y ;代码迷惑
;#AutoIt3Wrapper_Run_AU3Check= ;语法检查
;#AutoIt3Wrapper_Run_Before= ;运行前
;#AutoIt3Wrapper_Run_After= ;运行后
#EndRegion AutoIt3Wrapper 预编译参数(常用参数)
#cs ____________________________________
AutoIt 版本: 3.2.13.7 (第二版)
脚本作者:
Email:
QQ/TM:
脚本版本:
脚本功能:
#ce _______________脚本开始_________________
$g_szVersion = "天气预报"
If WinExists($g_szVersion) Then Exit ; 此脚本已经运行了
AutoItWinSetTitle($g_szVersion)
Opt("GUICloseOnESC", 0)
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 0)
Opt("TrayIconHide", 0)
#include <IE.au3>
Local Const $weatherFile = @ScriptDir & "\天气预报.ini"
Local Const $city = IniRead($weatherFile, "天气预报", "城市", "上海")
IniWrite($weatherFile, "天气预报", "城市", $city)
$Url = "http://weather.tq121.com.cn/mapanel/index1.php?city=" & $city
$oIE = _IECreate($Url, 0, 0)
$sHTML = _IEBodyReadHTML($oIE)
$array = StringRegExp($sHTML, "<(?i)TD class=weather vAlign=top align=middle width=160>(.*?)</(?i)td>", 1)
For $i = 0 To UBound($array) - 1
$tqtemp = $array[$i]
Next
$weather = StringReplace($tqtemp, " ", " ")
$array2 = StringRegExp($sHTML, "<(?i)TD class=weatheren vAlign=top align=middle width=160>(.*?)</(?i)td>", 1)
For $i = 0 To UBound($array2) - 1
$tqtemp2 = $array2[$i]
Next
$weatheren = StringReplace($tqtemp2, " ", " ")
$array3 = StringRegExp($sHTML, "<(?i)span class=big-cn>(.*?)<(?i)br>", 1)
For $i = 0 To UBound($array3) - 1
$tqtemp3 = $array3[$i]
Next
$wind = StringReplace($tqtemp3, " ", " ")
$array4 = StringRegExp($sHTML, "<(?i)br>紫外线:(.*?)</(?i)span>", 1)
For $i = 0 To UBound($array4) - 1
$tqtemp4 = $array4[$i]
Next
$ultraviolet = StringReplace($tqtemp4, " ", " ")
IniWrite($weatherFile, "天气预报", "天气", $weather)
IniWrite($weatherFile, "天气预报", "温度", $weatheren)
IniWrite($weatherFile, "天气预报", "风力", $wind)
IniWrite($weatherFile, "天气预报", "紫外线", $ultraviolet)
_IEQuit($oIE)
Exit |
|