diff options
Diffstat (limited to 'modules/isgd.py')
| -rw-r--r-- | modules/isgd.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/isgd.py b/modules/isgd.py index ba7c5618..f47a3df3 100644 --- a/modules/isgd.py +++ b/modules/isgd.py @@ -1,24 +1,23 @@ import re -from src import ModuleManager, Utils +from src import ModuleManager, utils ISGD_API_URL = "https://is.gd/create.php" REGEX_URL = re.compile("https?://", re.I) class Module(ModuleManager.BaseModule): - @Utils.hook("get.shortlink") + @utils.hook("get.shortlink") def shortlink(self, event): url = event["url"] if not re.match(REGEX_URL, url): url = "http://%s" % url - data = Utils.get_url(ISGD_API_URL, get_params={ - "format": "json", - "url": url - }, json=True) + + data = utils.http.get_url(ISGD_API_URL, get_params= + {"format": "json", "url": url}, json=True) if data and data["shorturl"]: return data["shorturl"] - @Utils.hook("received.command.shorten", min_args=1) + @utils.hook("received.command.shorten", min_args=1) def shorten(self, event): """ :help: Shorten a given URL using the is.gd service |
