This is a simple script to fetch tweets unsing Twitter API based on hashtag_phrase. The hashtags can be added in the .env file including fields for API keys. This script writes all the data fetched in .csv file. It does not query historical data.
-
Add twitter API keys and hashtags in the .env file
-
Install dependencies from requirments.txt
> python3 -m pip install -r requirements.txt
- then as simple as running the script
> python3 tweet_scraper.py
- To run it in detached shell [OPTIONAL]
> nohup python3 tweet_scaper.py &