2

I'm trying to get tweets from twitter using tweepy but I keep getting truncated tweets. I understand that twitter automatically truncates tweets if the RT is added to the front making it too long so in that case you would use the retweeted_status element to get the original text. My problem is that the retweeted_status is being truncated by twitter because it seems to add a URL to the end.

text: RT @nytgraphics: President Trump is at his VA golf course today. It’s his 16th visit to the club as president.…

retweeted_status: President Trump is at his VA golf course today. It’s his 16th visit to the club as president.…https://twitter.com/i/web/status/917430220499685376 (there is actually a shortened twitter link here but SO wont let me put a shortened link)

I'm not sure why it does this. The retweeted status is marked as truncated but not as retweeted or quoted.

How can I just get the original text of the retweet or just get the full text of everything (AKA RT @soandso "untruncated text")

1 Answers1

3

Yes, you can get extended tweets. It is documented here.

Supply this parameter to your request: tweet_mode=extended. Get the extended tweet text in this field: full_text.

Jonas
  • 3,969
  • 2
  • 25
  • 30
  • I thought this worked as I looked into the documentation and found what I needed to make the extended tweets work for my stream, but I am still getting tweets truncated even when 'truncated' is not set to true. I have to use the normal 'text' sometimes because the stream is still in compatibility mode and not every tweet contains 'full_text'. So I can only use the extended tweet when it exists, and when it doesn't twitter still seems to be truncating the tweet. – Riley White Oct 22 '17 at 01:25
  • Also the tweets that are cut off are not necessary 140 characters. – Riley White Oct 22 '17 at 01:42
  • Are the tweets that are cutoff and that do not have `truncated=true` retweets? – Jonas Oct 22 '17 at 16:24
  • Yes they were. I seemed to have fixed the issue however. I had assumed that if the tweet was truncated due to a retweet that it would be marked as truncated, but that doesn't seem to be the case. So I checked for the re-tweeted status dictionary and then dealt with it that way. Thank you for your help! – Riley White Oct 22 '17 at 18:26