15 lines
340 B
Lua
15 lines
340 B
Lua
local internet = require("internet")
|
|
|
|
while true do
|
|
local handle = internet.request("http://worldclockapi.com/api/json/utc/now")
|
|
local result = ""
|
|
for chunk in handle do
|
|
result = result..chunk
|
|
end
|
|
local f = io.open("time.txt", "w")
|
|
f:write(result)
|
|
f:seek("set", 31)
|
|
local time = f:read(16)
|
|
f:close()
|
|
print(time)
|
|
end
|