obdfcascrape/ee.js
Martin Donnelly be5d3eae07 init
2019-05-05 20:13:56 +01:00

24 lines
488 B
JavaScript

#!/usr/bin/env node
const CronJob = require('cron').CronJob;
// load env variables from file
require('dotenv').config();
const Estonia = require('./ncas/ee');
async function run() {
const eeScraper = new Estonia();
if (typeof(process.env.EE_CRON) === 'string' )
new CronJob(process.env.EE_CRON, async () => {
await eeScraper.run();
}, null, true);
if (process.env.SCRAPE_START === eeScraper.id)
await eeScraper.run();
console.log('EE Launched');
}
run();