bocchilorenzo / ntscraper

Scrape from Twitter using Nitter instances
MIT License
181 stars 29 forks source link

Search for tweets that mention a particular handle #27

Closed eekom-research closed 1 year ago

eekom-research commented 1 year ago

Hello, If I try to search for tweets that mention a specific username, for example, github_hash_tweets = scraper.get_tweets("@github", mode='term'), it still shows mostly entries mentioning the term 'github', which is not what I want. Is there an option or workflow where I can get tweets tweeted to a particular user?

bocchilorenzo commented 1 year ago

Right now there is no way to apply this type of filtering. I'll add it in future versions.

psegovias commented 1 year ago

Hello, If I try to search for tweets that mention a specific username, for example, github_hash_tweets = scraper.get_tweets("@github", mode='term'), it still shows mostly entries mentioning the term 'github', which is not what I want. Is there an option or workflow where I can get tweets tweeted to a particular user?

Did you try with operator 'to:'

github_hash_tweets = scraper.get_tweets("to:github", mode='term')

bocchilorenzo commented 1 year ago

I've added all the filters in Nitter, plus the "to" and "lang" filters that were discussed here in the issues. Simply add to="username" to the get_tweets call to use it.