From 12181bfec6c3219571d50779a21e649f23e2b030 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 25 Jun 2019 17:53:00 +0100 Subject: Add system to have multiple url shorteners and chose which to use --- modules/tweets/format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/tweets/format.py') diff --git a/modules/tweets/format.py b/modules/tweets/format.py index c41fde17..090ec6cd 100644 --- a/modules/tweets/format.py +++ b/modules/tweets/format.py @@ -6,7 +6,7 @@ def _timestamp(dt): since, unit = utils.time_unit(seconds_since) return "%s %s ago" % (since, unit) -def _tweet(exports, tweet): +def _tweet(exports, server, tweet): linked_id = tweet.id username = tweet.user.screen_name @@ -17,7 +17,7 @@ def _tweet(exports, tweet): tweet_link = "https://twitter.com/%s/status/%s" % (username, linked_id) - short_url = exports.get_one("shortlink")(tweet_link) + short_url = exports.get_one("shorturl")(server, tweet_link) short_url = " - %s" % short_url if short_url else "" created_at = _timestamp(tweet.created_at) -- cgit v1.3.1-10-gc9f91