aboutsummaryrefslogtreecommitdiff
path: root/modules/urbandictionary.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-12-11 22:26:38 +0000
committerGravatar jesopo2018-12-11 22:26:38 +0000
commit793d234a0b924c0330e88f07f68b13559b42e4ac (patch)
tree90ecd3746a77e17da915f90ec057cb16ead82c05 /modules/urbandictionary.py
parentActually use `action_desc` in github.py.issues, so that we can see what things (diff)
signature
'utils.http.get_url' -> 'utils.http.request', return a Response object from
utils.http.request
Diffstat (limited to 'modules/urbandictionary.py')
-rw-r--r--modules/urbandictionary.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/urbandictionary.py b/modules/urbandictionary.py
index b63683c2..806495fd 100644
--- a/modules/urbandictionary.py
+++ b/modules/urbandictionary.py
@@ -18,12 +18,12 @@ class Module(ModuleManager.BaseModule):
if match:
number = int(match.group(1))
term = term.split(" ", 1)[1]
- page = utils.http.get_url(URL_URBANDICTIONARY,
+ page = utils.http.request(URL_URBANDICTIONARY,
get_params={"term": term}, json=True)
if page:
- if len(page["list"]):
- if number > 0 and len(page["list"]) > number-1:
- definition = page["list"][number-1]
+ if len(page.data["list"]):
+ if number > 0 and len(page.data["list"]) > number-1:
+ definition = page.data["list"][number-1]
event["stdout"].write("%s: %s" % (definition["word"],
definition["definition"].replace("\n", " ").replace(
"\r", "").replace(" ", " ")))