Description Usage Arguments Value
This function is a complete bot-in-a-box that will search Ontario's
provincial vaccine booking system for empty slots and tweet them out. It uses
the covaxr package's get_locations()
and check_locations_covax()
functions for reading the booking system, and the rtweet package to tweet
them out. Please note this is an unofficial product, in no way affiliated
with the Government of Ontario, and it comes with no warranty and is to be
used at your own risk.
If you're just looking for yourself, you can run it in "local mode" and updates will be printed to the console without tweeting.
I've described the function parameters below, but please note you need two things for this to work:
A Provincial API Key. If you have an Ontario Health Card and can log
into the provincial COVID-19 booking system, then you have an API key. You
can find it by monitoring Chrome's developer console under the 'Network'
tab and looking for the value it passes for vaccineData
when it makes API
calls. The function won't work without one.
Twitter Credentials. The rtweet package authors put together a good guide on using OAuth with Twitter, and you can read it here (https://cran.r-project.org/web/packages/rtweet/vignettes/auth.html.)
A latitude & longitude. The provincial API will return locations near here.
A dose number. 1 or 2; at this point 1 is more urgent and dose 2 values may not be reliable.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | covax_twitter_bot(
twitter_app_name = NA,
twitter_consumer_key = NA,
twitter_consumer_secret = NA,
twitter_access_token = NA,
twitter_access_secret = NA,
local_mode = TRUE,
covax_api_key,
lat = 45.38,
lon = -75.69,
dose_number = 1,
days_in_future = 3,
search_radius = 25,
update_delay = 1,
verbose = TRUE
)
|
twitter_app_name |
The name of your Twitter app (only if not in local mode). |
twitter_consumer_key |
Your Twitter consumer key (only if not in local mode). |
twitter_consumer_secret |
Your Twitter consumer secret key (only if not in local mode). |
twitter_access_token |
Your Twitter access token (only if not in local mode). |
twitter_access_secret |
Your twitter access secret key (only if not in local mode). |
local_mode |
Boolean. Should the bot run in local mode and only print results to the console (default), or should it post updates to Twitter? |
covax_api_key |
Your personal provincial booking system API key. |
lat |
The latitude to search. |
lon |
The longitude to search. |
dose_number |
The does number to search for (1 or 2). |
days_in_future |
How many days in the future to look (default is 3). |
search_radius |
Radius in km to search around supplied latitude and longitude. |
update_delay |
How many minutes to wait between updates. |
verbose |
Boolean. Would you like lots of updates to the console? |
Returns nothing; runs until terminated.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.