-
Notifications
You must be signed in to change notification settings - Fork 4
/
FY4A-true-color.lua
40 lines (36 loc) · 1.21 KB
/
FY4A-true-color.lua
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
27
28
29
30
31
32
33
34
35
36
37
38
39
-- FY4A真彩色
local Api = require("coreApi")
local http = require("http")
function ReceiveFriendMsg(CurrentQQ, data) return 1 end
function ReceiveEvents(CurrentQQ, data, extData) return 1 end
function ReceiveGroupMsg(CurrentQQ, data)
if data.FromUserId == tonumber(CurrentQQ) then
return 1
end
if data.Content:find('真彩色') then
local resp = http.request('GET', 'http://m.nmc.cn/publish/satellite/FY4A-true-color.htm')
if resp ~= nil then
local body = resp.body
local url = body:match([[data%-src="(.-)".+<div class=swiper%-button%-prev>]])
print(url)
if url ~= nil then
Api.Api_SendMsg(
CurrentQQ,
{
toUser = data.FromGroupId,
sendToType = 2,
sendMsgType = "PicMsg",
content = '',
groupid = 0,
atUser = 0,
picUrl = url,
picBase64Buf = "",
fileMd5 = ""
}
)
return 2
end
end
end
return 1
end