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

81 lines
1.6 KiB
JavaScript

#!/usr/bin/env node
const CronJob = require('cron').CronJob;
// load env variables from file
require('dotenv').config();
// TODO:
// parse arguments - we should run just 1 FCA per go &
// have option to run selected company from selected NCA
const argv = require('yargs').argv;
// load helper libs etc
// const Fca = require('./ncas/fca');
const Ireland = require('./ncas/ie');
const Denmark = require('./ncas/dk');
const France = require('./ncas/fr');
const Cyprus = require('./ncas/cy');
const Germany = require('./ncas/de');
const Netherlands = require('./ncas/nl');
const Sweden = require('./ncas/se');
const Malta = require('./ncas/mt');
async function run() {
// const fcaScraper = new Fca();
const ieScraper = new Ireland();
const dkScraper = new Denmark();
const frScraper = new France();
const cyScraper = new Cyprus();
const deScraper = new Germany();
const nlScraper = new Netherlands();
const seScraper = new Sweden();
const mtScraper = new Malta();
// fcaScraper.run();
// await ieScraper.run();
/*
await dkScraper.run();
// dkScraper.run();
await frScraper.run();
await cyScraper.run();
await ieScraper.run();
*/
// await nlScraper.run();
// await seScraper.run();
// await deScraper.run();
// await cyScraper.run();
// await frScraper.run();
// console.log('Launched');
console.log(new Date());
new CronJob('05 16 * * *', async function() {
await ieScraper.run();
}, null, true);
new CronJob('05 16 * * *', async function() {
await frScraper.run();
}, null, true);
}
run();