#!/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();