diff --git a/lapis/app.lua b/lapis/app.lua index 4b0ce7f..a0251e8 100644 --- a/lapis/app.lua +++ b/lapis/app.lua @@ -19,7 +19,7 @@ app:get("/embed", function(self) if from == nil then return {"cups webring embed needs from defined (.../embed?from=me)"} end - return string.format('
', config.host, from, config.host, config.host, config.host, config.host, from, config.host), {layout = false, content_type="text/html"} + return string.format('', config.host, from, config.host, config.host, config.host, config.host, from, config.host), {layout = false, content_type="text/html"} end) app:get("/random", function(self) @@ -39,6 +39,10 @@ app:get("/next", function(self) found = true end end + if "cups" == self.params.from then + rand = math.random(1,#members-1) + return {redirect_to=members[rand][2]} + end return {redirect_to="/"} end) @@ -55,6 +59,10 @@ app:get("/prev", function(self) found = true end end + if "cups" == self.params.from then + rand = math.random(1,#members-1) + return {redirect_to=members[rand][2]} + end return {redirect_to="/"} end)