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

29 lines
621 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 Italy = require('./ncas/it');
async function run() {
const itScraper = new Italy();
if (typeof(process.env.IT_CRON) === 'string' )
new CronJob(process.env.IT_CRON, async function() {
await itScraper.run();
}, null, true);
if (process.env.SCRAPE_START === itScraper.id)
await itScraper.run();
console.log('IT Launched');
}
process.once('uncaughtException', function caught(err) {
console.error('Uncaught', err);
});
run();