obdfcascrape/gi.js

26 lines
534 B
JavaScript
Raw Permalink Normal View History

2019-05-05 19:13:56 +00:00
#!/usr/bin/env node
const CronJob = require('cron').CronJob;
// load env variables from file
require('dotenv').config();
const argv = require('yargs').argv;
const Gibraltar = require('./ncas/gi');
async function run() {
const giScraper = new Gibraltar();
if (typeof(process.env.GI_CRON) === 'string' )
new CronJob(process.env.GI_CRON, async function() {
await giScraper.run();
}, null, true);
if (process.env.SCRAPE_START === giScraper.id)
await giScraper.run();
console.log('GI Launched');
}
run();