Vaccine Tracker Ontario on Twitter
Project page: https://lindayi.me/vaccinebotto/
- python (tested on 3.6.9)
- numpy (tested on 1.19.0)
- tweepy (tested on 3.10.0)
- Replace the
TWITTER_CONSUMER_KEY
,TWITTER_CONSUMER_SECRET
,TWITTER_ACCESS_KEY
, andTWITTER_ACCESS_SECRET
values with your own Twitter account credentials. - Replace the
BASE_PATH
value with the path that you intend to run the script under. The script will read the status fileon_vax_tracker_last_date.ini
from theBASE_PATH
. Feel free to modifySTATUS_PATH
as well if you do not like the file name or do not intend to store the status file under the same directory as the script. - (Optional) Modify parameters such as
ON_POPULATION
,BAR_LENGTH
, andTWEET_TEMPLATE
. It may be a good idea to test if your template is over the length limit of a tweet. - Update the status file (
on_vax_tracker_last_date.ini
) to one day before the date that you intend to start tweeting from. It can be a date in the past or future. - Set up a crontab job to run the script periodically. For example:
*/5 10 * * * python3 /projects/vacbot/on_vax_tracker.py >> /projects/vacbot/on_vax_tracker.log
. Don't worry, the script updates the status file and won't repeatedly tweet what has already been tweeted.
For the detailed process of obtaining credentials for your Twitter account, please see https://realpython.com/twitter-bot-python-tweepy/#creating-twitter-api-authentication-credentials