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

24 lines
486 B
JavaScript

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