#!/usr/bin/env node const CronJob = require('cron').CronJob; // load env variables from file require('dotenv').config(); const Greece = require('./ncas/gr'); async function run() { const grScraper = new Greece(); if (typeof(process.env.GR_CRON) === 'string' ) new CronJob(process.env.GR_CRON, async function() { await grScraper.run(); }, null, true); if (process.env.SCRAPE_START === grScraper.id) await grScraper.run(); console.log('GR Launched'); } run();