signage: bring in from external repo

This is b28e6f07aa48f1e2f01eb37bffa180f97a7b03bd from
https://code.hackerspace.pl/q3k/love2d-signage/. We only keep code
commited by inf and q3k, and we're both now licensing this code under
the ISC license, as per COPYING in the root of hscloud.

Change-Id: Ibeee2e6923605e4b1a17a1d295867c056863ef59
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1335
Reviewed-by: informatic <informatic@hackerspace.pl>
Reviewed-by: q3k <q3k@hackerspace.pl>
diff --git a/hswaw/signage/nodes/currency_thread.lua b/hswaw/signage/nodes/currency_thread.lua
new file mode 100644
index 0000000..77b98dc
--- /dev/null
+++ b/hswaw/signage/nodes/currency_thread.lua
@@ -0,0 +1,22 @@
+local socket = require("socket")
+local http = require("socket.http")
+local json = require("vendor.json")
+local lume = require("vendor.lume")
+
+local btcURL = 'http://www.bitmarket.pl/json/BTCPLN/ticker.json'
+local tryURL = 'http://api.fixer.io/latest?base=TRY'
+
+local r, c, h = http.request(btcURL)
+if c == 200 then
+  btcpln = json.decode(r)['last']
+  local r, c, h = http.request(tryURL)
+  if c == 200 then
+    tryidr = json.decode(r)['rates']['IDR']
+  end
+  love.thread.getChannel('currency'):push({
+    values = {math.floor(btcpln), math.floor(tryidr)},
+  })
+  print("Update finished")
+else
+  print("Update failed")
+end