To use the script as is,
- Make sure to have all the requirements installed (e.g., run
pip install requirements.txt
orconda install --file requirements.txt
) - Make sure a valid .xlsx file exists in the /data folder, containing 2 sheets, for vendors and keywords
- From a terminal, run
python get_tweets.py [BEARER_TOKEN]
Notes:
- if you do not have your Bearer Token already saved, go to The Twitter Developer Dashboard, click on you project --> 'Keys and tokens' and click on "Regenerate" for Bearer Token; copy and save that token;
- you do not need to add anything else (e.g., apostrophes/quotation marks) to the token; simply paste it
Alternatively, instead of step 1, you can modify the get_tweets.py to include desired vendor/keywords. For this, delete the lines where 'VENDORS'/'KEYWORDS' are assigned values and replace them with python lists of strings, e.g.:
VENDORS = ['vendor_name_1', 'vendor_name_2'] KEYWORDS = ['keyword_1', 'keyword_2', 'keyword_3']
Steps 2 and 3 are the same.