use "extended" tweet mode so long tweets are not truncated

This commit is contained in:
jesopo 2019-07-15 14:27:37 +01:00
parent 5cae13edba
commit 5b1b26160a
2 changed files with 4 additions and 3 deletions

View file

@ -76,7 +76,8 @@ class Module(ModuleManager.BaseModule):
return tweepy.API(auth)
def _from_id(self, tweet_id):
return self._get_api(self._get_auth()).get_status(tweet_id)
return self._get_api(self._get_auth()).get_status(tweet_id,
tweet_mode="extended")
def _from_username(self, username):
return self._get_api(self._get_auth()).user_timeline(
screen_name=username, count=1)[0]

View file

@ -24,12 +24,12 @@ def _tweet(exports, server, tweet):
# having to use hasattr here is nasty.
if hasattr(tweet, "retweeted_status"):
original_username = tweet.retweeted_status.user.screen_name
original_text = tweet.retweeted_status.text
original_text = tweet.retweeted_status.full_text
original_timestamp = _timestamp(tweet.retweeted_status.created_at)
return "(@%s%s (%s) retweeted @%s (%s)) %s%s" % (username, verified,
created_at, original_username, original_timestamp,
html.unescape(original_text), short_url)
else:
return "(@%s%s, %s) %s%s" % (username, verified, created_at,
html.unescape(tweet.text), short_url)
html.unescape(tweet.full_text), short_url)