Update linkedGet.lua
This commit is contained in:
parent
2bd3b6a3c5
commit
3a0a230c9c
1 changed files with 13 additions and 1 deletions
|
@ -7,7 +7,19 @@ local success = "console: команда выполнена успешно"
|
||||||
local fail = "console: неизвестная команда - пиши help"
|
local fail = "console: неизвестная команда - пиши help"
|
||||||
|
|
||||||
function getTime()
|
function getTime()
|
||||||
local _, _, _, _, _, time = event.pull("modem_message")
|
local handle = internet.request("http://api.timezonedb.com/v2.1/get-time-zone?key=INWE0H77BDN6&by=zone&zone=Europe/Moscow&format=json")
|
||||||
|
local result = ""
|
||||||
|
|
||||||
|
for chunk in handle do
|
||||||
|
result = result..chunk
|
||||||
|
end
|
||||||
|
local f = io.open("time.txt", "w")
|
||||||
|
f:write(result)
|
||||||
|
f:close()
|
||||||
|
f = io.open("time.txt", "r")
|
||||||
|
f:seek("set", 245)
|
||||||
|
local time = f:read(19)
|
||||||
|
f:close()
|
||||||
return time
|
return time
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue