From e47322bdfb845440462019be7dfbd5eb0e99fad2 Mon Sep 17 00:00:00 2001 From: Luke Cotterell <44589876+NxtDaemon@users.noreply.github.com> Date: Sat, 24 Jul 2021 17:43:58 +0100 Subject: [PATCH] Changing API Access Mode to Extended using the "extended" value will ensure all tweets are parsed for all 280 characters and not truncated --- tweets_analyzer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tweets_analyzer.py b/tweets_analyzer.py index 7a96129..79e35f3 100755 --- a/tweets_analyzer.py +++ b/tweets_analyzer.py @@ -209,12 +209,12 @@ def get_friends(api, username, limit): def get_tweets(api, username, fh, limit): """ Download Tweets from username account """ if args.json is False: - for status in tqdm(tweepy.Cursor(api.user_timeline, screen_name=username).items(limit), unit="tw", total=limit): + for status in tqdm(tweepy.Cursor(api.user_timeline, screen_name=username,tweet_mode="extended").items(limit), unit="tw", total=limit): process_tweet(status) if args.save: fh.write(str(json.dumps(status._json))+",") else: - for status in (tweepy.Cursor(api.user_timeline, screen_name=username).items(limit)): + for status in (tweepy.Cursor(api.user_timeline, screen_name=username,tweet_mode="extended").items(limit)): process_tweet(status) if args.save: fh.write(str(json.dumps(status._json))+",")