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

26 lines
525 B
JavaScript

#!/usr/bin/env node
const CronJob = require('cron').CronJob;
// load env variables from file
require('dotenv').config();
const argv = require('yargs').argv;
const Finland = require('./ncas/fi');
async function run() {
const fiScraper = new Finland();
if (typeof(process.env.FI_CRON) === 'string' )
new CronJob(process.env.FI_CRON, async () => {
await fiScraper.run();
}, null, true);
if (process.env.SCRAPE_START === fiScraper.id)
await fiScraper.run();
console.log('FI Launched');
}
run();