Update getTime.lua
This commit is contained in:
parent
6113b3da56
commit
2bd3b6a3c5
1 changed files with 12 additions and 18 deletions
|
@ -1,12 +1,8 @@
|
|||
local internet = require("internet")
|
||||
local component = require("component")
|
||||
local modem = component.modem
|
||||
|
||||
modem.open(69)
|
||||
|
||||
while true do
|
||||
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
|
||||
|
@ -18,5 +14,3 @@ while true do
|
|||
local time = f:read(19)
|
||||
f:close()
|
||||
print(time)
|
||||
--modem.broadcast(69, time)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue