JustAnotherArchivist / snscrape

A social networking service scraper in Python
GNU General Public License v3.0
4.33k stars 699 forks source link

Combining Searching for Historical with User #183

Closed kevinhuang99 closed 3 years ago

kevinhuang99 commented 3 years ago

How would you search for a particular user's historical tweet data? And how do you also incorporate the text-query into all of this? Like if I wanted to search a particular user's historical tweet data and filter out specific text how would I write that using the CLI commands?

JustAnotherArchivist commented 3 years ago

Here's an example that searches for tweets posted by @username in the year 2017 containing searchterm:

snscrape twitter-search 'from:username searchterm since:2017-01-01 until:2018-01-01'

112

kevinhuang99 commented 3 years ago

How would you write that in jupyter notebooks? I have this right now os.system('snscrape --jsonl --max-results {} twitter-search "from: {} searchterm since:{} until:{}"> teslaX-tweets.json'.format(tweet_count1, username1, since_date, until_date )) but the dataframe from reading in the json file is blank

JustAnotherArchivist commented 3 years ago

Sorry, can't help with specific environments that I'm not familiar with. But if you search the issues for 'jupyter', you'll find various examples by others.