wilmerags commited on
Commit
59ff44b
·
1 Parent(s): 1731f45

feat: Exclude retweets and replies to get denser content

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -111,11 +111,11 @@ if tw_user:
111
  tweets_objs = []
112
  while tw_sample >= 100:
113
  current_sample = min(100, tw_sample)
114
- tweets_response = client.get_users_tweets(usr.data.id, max_results=current_sample)
115
  tweets_objs += tweets_response.data
116
  tw_sample -= current_sample
117
  if tw_sample > 0:
118
- tweets_response = client.get_users_tweets(usr.data.id, max_results=tw_sample)
119
  tweets_objs += tweets_response.data
120
  tweets_txt = [tweet.text for tweet in tweets_objs]
121
  tweets_txt = list(set(tweets_txt))
 
111
  tweets_objs = []
112
  while tw_sample >= 100:
113
  current_sample = min(100, tw_sample)
114
+ tweets_response = client.get_users_tweets(usr.data.id, max_results=current_sample, exclude=['retweets', 'replies'])
115
  tweets_objs += tweets_response.data
116
  tw_sample -= current_sample
117
  if tw_sample > 0:
118
+ tweets_response = client.get_users_tweets(usr.data.id, max_results=tw_sample, exclude=['retweets', 'replies'])
119
  tweets_objs += tweets_response.data
120
  tweets_txt = [tweet.text for tweet in tweets_objs]
121
  tweets_txt = list(set(tweets_txt))