aboutsummaryrefslogtreecommitdiff
path: root/modules/urbandictionary.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-03 13:22:37 +0100
committerGravatar jesopo2018-10-03 13:22:37 +0100
commit69d58eede2e9bf83aa1ed1d8fcf956efde494726 (patch)
tree11aa30f2a357f3be23ad97315dae3df051455cbe /modules/urbandictionary.py
parentAdd a way to not add a user automatically in IRCServer.get_user (diff)
signature
Move src/Utils.py in to src/utils/, splitting functionality out in to modules of
related functionality
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 2d5edd21..2f86ff6b 100644
--- a/modules/urbandictionary.py
+++ b/modules/urbandictionary.py
@@ -1,11 +1,11 @@
import json, re
-from src import ModuleManager, Utils
+from src import ModuleManager, utils
URL_URBANDICTIONARY = "http://api.urbandictionary.com/v0/define"
REGEX_DEFNUMBER = re.compile("-n(\d+) \S+")
class Module(ModuleManager.BaseModule):
- @Utils.hook("received.command.urbandictionary|ud", min_args=1)
+ @utils.hook("received.command.urbandictionary|ud", min_args=1)
def ud(self, event):
"""
:help: Get the definition of a provided term from Urban Dictionary
@@ -17,8 +17,8 @@ class Module(ModuleManager.BaseModule):
if match:
number = int(match.group(1))
term = term.split(" ", 1)[1]
- page = Utils.get_url(URL_URBANDICTIONARY, get_params={"term": term},
- json=True)
+ page = utils.http.get_url(URL_URBANDICTIONARY,
+ get_params={"term": term}, json=True)
if page:
if len(page["list"]):
if number > 0 and len(page["list"]) > number-1: