obdfcascrape/lt.js

26 lines
529 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 Lithuania = require('./ncas/lt');
async function run() {
const lsScraper = new Lithuania();
if (typeof(process.env.LT_CRON) === 'string' )
new CronJob(process.env.LT_CRON, async () => {
await lsScraper.run();
}, null, true);
if (process.env.SCRAPE_START === lsScraper.id)
await lsScraper.run();
console.log('LT Launched');
}
run();