#!/usr/bin/env node const CronJob = require('cron').CronJob; // load env variables from file require('dotenv').config(); const argv = require('yargs').argv; const Finland = require('./ncas/fi'); async function run() { const fiScraper = new Finland(); if (typeof(process.env.FI_CRON) === 'string' ) new CronJob(process.env.FI_CRON, async () => { await fiScraper.run(); }, null, true); if (process.env.SCRAPE_START === fiScraper.id) await fiScraper.run(); console.log('FI Launched'); } run();