A simple command line tool for Data Scientists to scrape tweets without using the Twitter API.
-
Clone the repository into your local machine.
git clone https://github.com/Dipankar-Medhi/tscrape.git
-
Make a virtual environemnt.
python -m venv venv
-
Activate the virtual environment
venv/Scripts/activate
-
Install the dependencies.
pip install -r requirements.txt
-
Open a terminal inside the current directory and run
$ python main.py
-
Enter the optional arguments.
$ python main.py Enter the keyword: <keyword> Tweets by username: <username> Username mentioned in the tweets: <mentioned-usermane> Scrape since: <start-date> Scrape till: <end-date> Number of tweets to scrape: <tweets-number> Name of the file: <output-file-name.csv>
-
All the downloaded tweets will be saved inside the
data
directory ascsv
files. -
CSV file contains the
date
,username
andtweets
columns.