random en 9gag

This commit is contained in:
yago 2014-08-05 14:20:53 +02:00
parent 0a6f071154
commit 0264ac2935

View File

@ -233,6 +233,7 @@ end
function get_infiniGAG()
b, c, h = http.request("http://infinigag-us.aws.af.cm")
local gag = json:decode(b)
math.randomseed(os.time())
i = math.random(#gag.data) -- random max json table size (# is an operator o.O)
local link_image = gag.data[i].images.normal
print("9gag image"..link_image)