Generate a cron job, and pass it to crontab. It will automatically scape flight data and save them to a local SQLite database file.
cron_create(origin, destination, startDate, returnDate = NULL, key = apiGetKey(), path = getwd(), frequency = "daily", at, id, ...)
origin | The origin place, can be country, city, airport, in Skyscanner code. |
---|---|
destination | The destination, can be country, city, airport, in Skyscanner code. |
startDate | The outbound date. Format 'yyyy-mm-dd'. |
returnDate | The return date. Format 'yyyy-mm-dd'. Use NULL for oneway trip. |
key | API key. Default using the key in global options, see |
path | Where to put the log, defaults is the current working directory. |
frequency | A character string equal to one of |
at | The actual time of day at which to execute the command. When unspecified, we default to
|
id | An id, or name, to give to the cronjob task, for easier revision in the future. |
... | Other arguments. |
# NOT RUN { apiSetKey("YOUR_API_KEY") cron_create("SFO", "LHR", "2019-07-01", frequency = "daily", at = "3AM") cron_create("SFO", "LHR", "2019-07-01", frequency = "hourly") cron_create("SFO", "LHR", "2019-07-01", frequency = "minutely") cron_create("SFO", "LHR", "2019-07-01", frequency = "0 */2 * * *") # every 2 hours # }