3

I used tweepy to write the code to streaming tweets, but it seems the tweets were truncated and the long tweets I got are not full, they are end with ...

Is there any way that I could streaming the full long tweets?

tienan li
  • 33
  • 1
  • 4
  • Possible duplicate of [Twitter search api text field value is truncated](https://stackoverflow.com/questions/38717816/twitter-search-api-text-field-value-is-truncated) – T.Todua Mar 01 '18 at 14:49

1 Answers1

8

Add this parameter to your request: tweet_mode=extended When parsing each tweet, use full_text instead of text.

It's documented here: https://developer.twitter.com/en/docs/tweets/tweet-updates.html

Jonas
  • 3,969
  • 2
  • 25
  • 30
  • But I try it on my code, it shows 'NameError: name 'extended' is not defined'. And from the document, I found 'extended' seems only work for the rest API, but I am using Streaming API – tienan li Nov 12 '17 at 20:39
  • And I read the tweet json format carefully, I found most of the tweets have 'full_text' in the 'extended_tweet'. However, the 'extended_tweet' sometimes in the 'retweeted_status', sometimes not. It's kind of confusing, I am not sure whether the text in 'full_text' equal to the 'text' wherever the 'full_text' is – tienan li Nov 12 '17 at 21:42
  • You will need to check if the tweet is a retweet. If it is, use the retweet's full_text. If it is not, use the tweet's full_text. – Jonas Nov 13 '17 at 15:00