- use full retweeted text for native retweets instead of truncating it
This commit is contained in:
Peter Rowlands 2014-08-13 14:43:05 -05:00
parent e589bd6e21
commit 9b35809372
1 changed files with 6 additions and 1 deletions

View File

@ -72,7 +72,12 @@ def twitter(inp, api_key=None):
except IndexError: except IndexError:
return 'error: not that many tweets found' return 'error: not that many tweets found'
text = http.unescape(tweet["text"]).replace('\n', ' ') if 'retweeted_status' in tweet:
rt = tweet["retweeted_status"]
rt_text = http.unescape(rt["text"]).replace('\n', ' ')
text = "RT @%s %s" % (rt["user"]["screen_name"], rt_text)
else:
text = http.unescape(tweet["text"]).replace('\n', ' ')
screen_name = tweet["user"]["screen_name"] screen_name = tweet["user"]["screen_name"]
time = tweet["created_at"] time = tweet["created_at"]