Improving quoted retweets

This commit is contained in:
Manuel Cortez 2016-06-28 10:41:13 -05:00
parent 5590ab47ee
commit 1ee629d731

View File

@ -51,8 +51,10 @@ def compose_tweet(tweet, db, relative_times):
user = tweet["user"]["name"]
source = re.sub(r"(?s)<.*?>", "", tweet["source"])
if tweet.has_key("retweeted_status"):
if tweet.has_key("message") == False:
if tweet.has_key("message") == False or tweet["retweeted_status"]["is_quote_status"] == False:
text = "RT @%s: %s" % (tweet["retweeted_status"]["user"]["screen_name"], StripChars(tweet["retweeted_status"]["text"]))
elif tweet["retweeted_status"]["is_quote_status"]:
text = "%s" % (StripChars(tweet[value]))
else:
text = "RT @%s: %s" % (tweet["retweeted_status"]["user"]["screen_name"], StripChars(tweet[value]))
if text[-1] in chars: text=text+"."