2017-01-08 12:54:01 +00:00
|
|
|
local socket = require("socket")
|
|
|
|
local http = require("socket.http")
|
|
|
|
local json = require("vendor.json")
|
|
|
|
local lume = require("vendor.lume")
|
|
|
|
|
2017-01-08 21:24:13 +00:00
|
|
|
local miseryURL = 'http://oodviewer.q3k.me/randomterm.json/_,'
|
2017-01-08 12:54:01 +00:00
|
|
|
|
|
|
|
local r, c, h = http.request(miseryURL)
|
|
|
|
if c == 200 then
|
2017-01-08 21:24:13 +00:00
|
|
|
love.thread.getChannel('misery'):push(json.decode(r))
|
2017-01-08 12:54:01 +00:00
|
|
|
print("Update finished")
|
|
|
|
else
|
|
|
|
print("Update failed")
|
|
|
|
end
|