Is it possible to filter tweets as they are being scraped by number of retweets or likes in twint or getoldtweets3?

Viewed 290
import twint

c = twint.Config()
c.Hide_output = True
c.Search = "TSLA"
c.Lang = "en"
c.Since = "2019-10-01 00:00:00"
c.Until = "2019-10-10 00:00:00"
c.Store_csv = True
c.Output = "TSLA.csv"

twint.run.Search(c)

This code takes a lot of time to execute and gets me 10,600 tweets, most of which add no value. I simply need tweets where retweets or likes are greater than a threshold. Unfortunately, documentation on twint and getoldtweets3 is quite light. Does anyone have any experience with this please?

2 Answers

try this code

c.Lang = "en"
c.Search = "TSLA"
StartDate = "2019-10-01"
EndDate = "2019-10-10"
c.Since = StartDate
c.Until = EndDate
c.Filter_retweets = True 
c.Store_csv = True
c.min_likes = 5 

Try to include min_retweets:20 or min_faves:20 (specifying the threshold) in the c.Search object.

c.Search = "TSLA min_retweets:20"
Related