From 75553783588a8fe33e894a0bb846cc2fcb1a04ca Mon Sep 17 00:00:00 2001 From: Akamaru Date: Sat, 18 Jul 2015 15:32:46 +0200 Subject: [PATCH] new pattern for urban_dictionary.lua --- plugins/urban_dictionary.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/urban_dictionary.lua b/plugins/urban_dictionary.lua index 4e779ba..2590d11 100644 --- a/plugins/urban_dictionary.lua +++ b/plugins/urban_dictionary.lua @@ -1,5 +1,5 @@ function getUrbanDictionary(text) - local topic = string.match(text, "/ud (.+)") or string.match(text, "http://([A-Za-z0-9-_-]+).urbanup.com/") + local topic = string.match(text, "/ud (.+)") or string.match(text, "http://([A-Za-z0-9-_-]+).urbanup.com/") or string.match(text, "http://www.urbandictionary.com/define.php[?]term=([A-Za-z0-9-_-]+)") topic = url_encode(topic) b = http.request("http://api.urbandictionary.com/v0/define?term=" .. topic) res = json:decode(b) @@ -35,7 +35,8 @@ return { description = "Zeigt eine Urban Dictionary Definition", usage = {"/ud [Begriff]"}, patterns = {"^/ud (.*)$", - "^http://([A-Za-z0-9-_-]+).urbanup.com/" + "^http://([A-Za-z0-9-_-]+).urbanup.com/", + "^http://www.urbandictionary.com/define.php[?]term=([A-Za-z0-9-_-]+)" }, run = run } \ No newline at end of file