获取天气_by sunwind_La_Lw



;作者:sunwind(1576157)
;左键+w显示天气,不同城市需要自行修改第6行的链接值:  http://www.weather.com.cn/data/cityinfo/101042200.html
#z::
;~ ~lbutton & w::
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
;~ WebRequest.Open("GET", "http://www.weather.com.cn/data/cityinfo/101042200.html")  ;垫江  不同地区更新此链接即可
WebRequest.Open("GET", "http://www.weather.com.cn/data/cityinfo/101010100.html")  ;北京 不同地区更新此链接即可
WebRequest.Send()
result := WebRequest.ResponseText
Clipboard:=result
; 用 json 提取数据, 和 javascript 类似
weather := json(result, "weatherinfo.weather")
temp1 := json(result, "weatherinfo.temp1")
temp2 := json(result, "weatherinfo.temp2")
ptime := json(result, "weatherinfo.ptime")

; 输出
ToolTip, 天气:%weather%`n%temp1% ~ %temp2%`n预报时间%ptime%
;~ KeyWait,w
Sleep,2000
ToolTip
Return


/*

	Function: JSON
	
	Parameters:
		js - source
		s - path to element
		v - (optional) value to overwrite
	
	Returns:
		Value of element (prior to change).
	
	License:
		- Version 2.0 by Titan 
		- New BSD license terms 

*/

json(ByRef js, s, v = "") {
	j = %js%
	Loop, Parse, s, .
	{
		p = 2
		RegExMatch(A_LoopField, "([+-]?)([^[]+)((?:[d+])*)", q)
		Loop {
			If (!p := RegExMatch(j, "(?

给TA捐赠
共{{data.count}}人
人已捐赠
其他

获取图片实际尺寸

2020-3-9 5:16:44

其他

获取所有激活窗口的详细信息

2020-3-9 5:18:44

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索