forked from zhacha222/sillyGirl-plug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ping.js
26 lines (21 loc) · 900 Bytes
/
ping.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 作者QQ1483081359
// [rule: 测速 ? ]
// [rule:测速?]
// [rule: ^ping (.*)$ ]
// [rule: ^ping(.*)$ ]
function main() {
var userID = GetUserID()//发送人用户id
var userName = GetUsername()
var address = param(1)
var content = request({
"url": "https://api.kit9.cn/api/measurement/?host="+address ,
"method": "get",
"dataType": "json"
})
if (content.code == 202) {
return sendText("[CQ:at,qq=" + userID + ",text=@" + userName + "]\n" + "该网站未解析!")
}
else
sendText("[CQ:at,qq=" + userID + ",text=@" + userName + "]" +"\n查询网址:" + address +"\nIP:" +content.data.ip+"\nIP地址:" + content.data.location + "\n最小延迟:"+ content.data.ping_time_min+"\n平均延迟:"+content.data.ping_time_avg+"\n最大延迟:" + content.data.ping_time_max +"\n归属地:"+content.data.node)
}
main()