#!/usr/bin/env node const CronJob = require('cron').CronJob; // load env variables from file require('dotenv').config(); const argv = require('yargs').argv; // load helper libs etc // const Fca = require('./ncas/fca'); const France = require('./ncas/fr'); async function run() { const frScraper = new France(); if (typeof(process.env.FR_CRON) === 'string' ) new CronJob(process.env.FR_CRON, async function() { await frScraper.run(); }, null, true); if (process.env.SCRAPE_START === frScraper.id) await frScraper.run(); console.log('FR Launched'); } process.once('uncaughtException', function caught(err) { console.error('Uncaught', err); }); run();