aboutsummaryrefslogtreecommitdiff
path: root/modules/tweets.py
diff options
context:
space:
mode:
authorGravatar dngfx2018-09-09 15:37:44 +0100
committerGravatar dongfix2018-09-09 15:37:44 +0100
commit23fbc2cb952811f7bc7cf3fe91d0102363ac7eb5 (patch)
tree691f20704e63090385794abd88ebda08806cc5cc /modules/tweets.py
parentFix spacing. (diff)
signature
Make URL shortening generic in tweets.py
Diffstat (limited to 'modules/tweets.py')
-rw-r--r--modules/tweets.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/tweets.py b/modules/tweets.py
index 8b0ebd76..bd097664 100644
--- a/modules/tweets.py
+++ b/modules/tweets.py
@@ -15,7 +15,7 @@ class Module(object):
def __init__(self, bot, events, exports):
self.bot = bot
- self.bitly_is_enabled = "bitly" in self.bot.modules.modules
+ self.url_shortener_enabled = "bitly" in self.bot.modules.modules
self.events = events
events.on("received").on("command").on("tweet", "tw"
@@ -67,13 +67,13 @@ class Module(object):
linked_id = tweet["id"]
username = "@%s" % tweet["user"]["screen_name"]
- bitly_link = ""
- if self.bitly_is_enabled:
+ url_shortener_link = ""
+ if self.url_shortener_enabled:
chopped_uname = username[1:]
tweet_link = "https://twitter.com/%s/status/%s" % (
chopped_uname, linked_id)
- bitly_link = " -- " + self.events.on("get").on(
+ url_shortener_link = " -- " + self.events.on("get").on(
"shortlink").call(
url=tweet_link)[0]
@@ -91,14 +91,14 @@ class Module(object):
username, retweet_timestamp,
original_username, original_timestamp,
original_text,
- bitly_link))
+ url_shortener_link))
else:
event["stdout"].write("(%s, %s) %s %s" % (username,
self.make_timestamp(
tweet[
"created_at"]),
tweet["text"],
- bitly_link)
+ url_shortener_link)
)
else:
event["stderr"].write("Invalid tweet identifiers provided")