obdfcascrape/at.js
Martin Donnelly a5109efabe 2019-05-12
2019-05-12 18:33:09 +01:00

24 lines
493 B
JavaScript

#!/usr/bin/env node
const CronJob = require('cron').CronJob;
// load env variables from file
require('dotenv').config();
const Austria = require('./ncas/at');
async function run() {
const atScraper = new Austria();
if (typeof(process.env.AT_CRON) === 'string' )
new CronJob(process.env.AT_CRON, async function() {
await atScraper.run();
}, null, true);
if (process.env.SCRAPE_START === atScraper.id)
await atScraper.run();
console.log('AT Launched');
}
run();