From a55f47a74b4eef442775a826a4a2faec96cb83d4 Mon Sep 17 00:00:00 2001 From: insweater Date: Thu, 5 Feb 2015 20:02:01 +0300 Subject: [PATCH] Add fetchTables --- gamejolt.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gamejolt.lua b/gamejolt.lua index f4d5bfa..75cfc99 100644 --- a/gamejolt.lua +++ b/gamejolt.lua @@ -204,4 +204,20 @@ function GJ.fetchScores(limit, tableID) return t end +function GJ.fetchTables() + local d = req("scores/tables/?", "keypair", false, false) + local t, f = {} + + parseKeypair(d, function(k, v) + if k ~= "success" then + if k == "id" then + f = {} + table.insert(t, f) + end + f[k] = v + end + end) + return t +end + return GJ \ No newline at end of file