obdfcascrape/be.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 Belgium = require('./ncas/be');
async function run() {
const beScraper = new Belgium();
if (typeof(process.env.BE_CRON) === 'string' )
new CronJob(process.env.BE_CRON, async function() {
await beScraper.run();
}, null, true);
if (process.env.SCRAPE_START === beScraper.id)
await beScraper.run();
console.log('BE launched');
}
run();