aboutsummaryrefslogtreecommitdiff
path: root/modules/bitly.py
diff options
context:
space:
mode:
authorGravatar dngfx2018-08-31 10:50:37 +0100
committerGravatar dngfx2018-08-31 10:50:37 +0100
commitabed9cf4ea71dcbad2dd2c049683b8d14b942e09 (patch)
tree3e40caf63fa7e1500469f4ad9a0c45c51808aad4 /modules/bitly.py
parentFix a copy paste fail in IRCLineHandler that caused PARTs to be handled as QUITs (diff)
signature
Reformat
Diffstat (limited to 'modules/bitly.py')
-rw-r--r--modules/bitly.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/bitly.py b/modules/bitly.py
index f31ca347..ca4242c0 100644
--- a/modules/bitly.py
+++ b/modules/bitly.py
@@ -1,4 +1,4 @@
-#--require-config bitly-api-key
+# --require-config bitly-api-key
import re
import Utils
@@ -6,13 +6,16 @@ import Utils
URL_BITLYSHORTEN = "https://api-ssl.bitly.com/v3/shorten"
REGEX_URL = re.compile("https?://", re.I)
+
class Module(object):
def __init__(self, bot):
self.bot = bot
bot.events.on("get").on("shortlink").hook(self.shortlink)
bot.events.on("received").on("command").on("shorten"
- ).hook(self.shorten, min_args=1, help="Shorten a URL.",
- usage="<url>")
+ ).hook(self.shorten,
+ min_args=1,
+ help="Shorten a URL.",
+ usage="<url>")
def shortlink(self, event):
url = event["url"]
@@ -26,7 +29,7 @@ class Module(object):
def shorten(self, event):
link = self.bot.events.on("get").on("shortlink"
- ).call_for_result(url=event["args"])
+ ).call_for_result(url=event["args"])
if link:
event["stdout"].write("Short URL: %s" % link)
else: