Serge Bazanski | 18c1a26 | 2022-07-07 14:24:53 +0200 | [diff] [blame] | 1 | local socket = require("socket") |
2 | local https = require("https") | ||||
3 | local json = require("vendor.json") | ||||
4 | local lume = require("vendor.lume") | ||||
5 | |||||
6 | local miseryURL = 'https://oodviewer.q3k.me/randomterm.json/_,' | ||||
7 | |||||
8 | local c, r, h = https.request(miseryURL) | ||||
9 | if c == 200 then | ||||
10 | love.thread.getChannel('misery'):push(json.decode(r)) | ||||
11 | print("Update finished") | ||||
12 | else | ||||
13 | print("Update failed: " .. tostring(c) .. ": " .. tostring(r)) | ||||
14 | end |