obdfcascrape/gr.js
Martin Donnelly be5d3eae07 init
2019-05-05 20:13:56 +01:00

24 lines
491 B
JavaScript

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