obdfcascrape/be.js

24 lines
493 B
JavaScript
Raw Normal View History

2019-05-12 17:33:09 +00:00
#!/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();