The script uses Flask as a RESTful API backend and Selenium in order to scrape tweets from Twitter. Flask will open a local web server on port 5000. Selenium will spin a browser in a separate window, so don't worry about that, just let it finish.
-
Make sure you're on a computer with either macOS or Linux installed. Windows isn't supported.
-
Make sure you have Python 3.6 or newer.
-
Install the latest Google Chrome browser.
-
Install requirements:
pip install -r requirements.txt
cd
to the root script folder and run:
python api.py
Returns the list of tweets with the given hashtag. Optional parameters:
- limit: integer, specifies the number of tweets to retrieve, default is 30
Sample requests:
Returns the list of tweets that user has on her feed. Optional parameters:
- limit: integer, specifies the number of tweets to retrieve, default is 30
Sample requests:
cd
to the root script folder and run:
python tests.py