Chuck Norris unesape HTML but HTML cant scape from Chuck Norris

This commit is contained in:
Akamaru 2015-06-23 16:41:31 +02:00
parent 04a95b6cc4
commit 3a104f5c04
1 changed files with 8 additions and 11 deletions

View File

@ -1,16 +1,13 @@
function getChuckNorris()
b = http.request("http://api.icndb.com/jokes/random/")
response = json:decode(b)
return response.value.joke
local function chuck()
local random = http.request("http://api.icndb.com/jokes/random")
local decode = json:decode(random)
local joke = decode.value.joke
return joke
end
function run(msg, matches)
local j = getChuckNorris()
if (j == nil) then
return "Huch, da lief was falsch!"
else
return j
end
local function run(msg)
local joke = chuck()
return unescape_html(joke)
end
return {