Advanced Twifty StreamListener Mode

My current very simple code is to use the twitter streaming API to easily print all tweets under a specific keyword in the console. However, I cannot figure out how to get the full text of the tweet instead of the truncated version. The program also uses in other places

    new_tweets = api.user_timeline(screen_name=username, count=200, tweet_mode='extended')

      

in which the last parameter specifies this exactly.

This is my current code:

class LiveTweetListener(tweepy.StreamListener):
    def on_status(self, status):
        try:
            print(status.full_text)
        except AttributeError:
            print(status.text)

    def on_error(self, status_code):
        if status_code == 420:
            print("420")
            return False

def start_stream(track):
    Listener = LiveTweetListener()
    stream = tweepy.Stream(auth=api.auth, listener=LiveTweetListener())
    stream.filter(track=track, async=True)

      

Passing tweet_mode = 'extended' with stream = tweepy.Stream doesn't seem to work

+3
python twitter tweepy


source to share


No one has answered this question yet

Check out similar questions:

3119
What is the difference between Python list methods that are appended and expanded?
2
Tweepy: advanced mode with api.search
2
Tweepy StreamListener ConnectionError
2
StreamListener with Tweepy, TypeError
0
Start StreamListener (Tweepy) and parse tweets at the same time
0
Tweepy StreamListener "def on_status" not executed
0
Tweedy Streamlistener string length
0
Transfer Twitter tweets to txt file
0
Twitter Stream with tweepy truncated
0
Tweedy Stream player for extended tweets



All Articles
Loading...
X
Show
Funny
Dev
Pics