Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not switchcraft then
- os.loadAPI("json")
- end
- local x,y = term.getCursorPos()
- while true do
- local obj = http.get("http://worldtimeapi.org/api/timezone/Europe/Helsinki").readAll()
- local tbl = json.decode(obj)
- local ts = tbl.unixtime
- term.setCursorPos(x,y)
- term.clearLine()
- term.write(os.date('%Y-%m-%d %H:%M:%S', ts))
- end
Add Comment
Please, Sign In to add comment