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

24 lines
480 B
JavaScript

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