#!/usr/bin/env node const CronJob = require('cron').CronJob; // load env variables from file require('dotenv').config(); const Latvia = require('./ncas/lv'); async function run() { const lvScraper = new Latvia(); if (typeof(process.env.LV_CRON) === 'string' ) new CronJob(process.env.LV_CRON, async () => { await lvScraper.run(); }, null, true); if (process.env.SCRAPE_START === lvScraper.id) await lvScraper.run(); console.log('LV Launched'); } run();