1

How do I get the full text of the tweet using the status object? I am streaming in extended mode but only getting a truncated version of the tweet text. How do I go about getting the full text of the tweet?

class TweetStream(StreamListener):

    def on_status(self, status):
        if not status.retweeted:
            print(status.text)


    def on_error(self, status):
        print(status)


auth = OAuthHandler(twitter_credentials.API_KEY,twitter_credentials.API_SECRET_KEY)
auth.set_access_token(twitter_credentials.ACCESS_TOKEN,twitter_credentials.ACCESS_TOKEN_SECRET)

twitterStream = Stream(auth=auth, listener=TweetStream(),tweet_mode='extended')
twitterStream.filter(track=["test"])
Yamin Himani
  • 77
  • 1
  • 9
  • Does this answer your question? [Getting full tweet text from "user\_timeline" with tweepy](https://stackoverflow.com/questions/42705314/getting-full-tweet-text-from-user-timeline-with-tweepy) – taha Jun 11 '20 at 22:51
  • You're using the Twitter streaming API, which includes extended Tweet data by default. The `tweet_mode=extended` parameter will not work with the streaming API. You need to check for the presence of the `extended_tweet` object inside the Tweet `status` object, and if it exists, print out the `full_text` field. – Andy Piper Jun 12 '20 at 13:55

0 Answers0