aboutsummaryrefslogtreecommitdiff
path: root/modules/urbandictionary.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-26 13:41:40 +0000
committerGravatar jesopo2019-11-26 13:42:01 +0000
commit2d21dfa22931bdb887ccccba4a33e6fa4755e94b (patch)
tree6ef5e304e3e9a69f9afd66ac0bee4d98ec115399 /modules/urbandictionary.py
parentremove all `eagle` stuff from nr.py (diff)
signature
utils.http.Response.data should always be `bytes` - add .decode and .soup
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 b71dc45b..a5098c3f 100644
--- a/modules/urbandictionary.py
+++ b/modules/urbandictionary.py
@@ -24,11 +24,11 @@ class Module(ModuleManager.BaseModule):
term = " ".join(term)
page = utils.http.request(URL_URBANDICTIONARY,
- get_params={"term": term}, json=True)
+ get_params={"term": term}).json()
if page:
- if len(page.data["list"]):
- if number > 0 and len(page.data["list"]) > number-1:
- definition = page.data["list"][number-1]
+ if len(page["list"]):
+ if number > 0 and len(page["list"]) > number-1:
+ definition = page["list"][number-1]
event["stdout"].write("%s: %s" % (definition["word"],
definition["definition"].replace("\n", " ").replace(
"\r", "").replace(" ", " ")))