twintproject / twint

An advanced Twitter scraping & OSINT tool written in Python that doesn't use Twitter's API, allowing you to scrape a user's followers, following, Tweets and more while evading most API limitations.
MIT License
15.66k stars 2.72k forks source link

While scraping a username, is it possible to get the reply/like/retweet count for each tweet? #650

Closed CyrisXD closed 4 years ago

CyrisXD commented 4 years ago

As title suggests, I'm looking to scrape a specific users tweets, and also get the reply, like and retweet count for each of those tweets.

I'd like to build my own program to loop over all the tweets and delete the tweets with no interactions as a "Twitter cleanup".

Any help appreciated. Cheers

CyrisXD commented 4 years ago

For those also here, I've figured it out by appending --stats to your query.

pielco11 commented 4 years ago

If you save tweets to csv or json files (or any other storing option, let it be db or elastic) those counters (likes, replies, retweets) are already reported

image

config.Stats is used to print those counters to stdout https://github.com/twintproject/twint/blob/81f6c2c516a231136fbd821bd6a53d7959965fee/twint/format.py#L49-L50