28 lines
795 B
JavaScript
28 lines
795 B
JavaScript
/**
|
|
* Created by WebStorm.
|
|
* User: martin
|
|
* Date: 16/04/2020
|
|
* Time: 23:35
|
|
|
|
*/
|
|
const CronJob = require('cron').CronJob;
|
|
const IndeedScraper = require('./scrapers/indeed');
|
|
const TotaljobsScraper = require('./scrapers/totaljobs');
|
|
|
|
(async function () {
|
|
console.log('Started..');
|
|
const indeedScraper = new IndeedScraper();
|
|
const totaljobsScraper = new TotaljobsScraper();
|
|
|
|
new CronJob('5 6-23/3 * * *', async function() {
|
|
await indeedScraper.go('london');
|
|
await totaljobsScraper.go('london');
|
|
await indeedScraper.go('glasgow');
|
|
await totaljobsScraper.go('glasgow');
|
|
await indeedScraper.go('edinburgh');
|
|
await totaljobsScraper.go('edinburgh');
|
|
await indeedScraper.go('milton keynes');
|
|
await totaljobsScraper.go('milton keynes');
|
|
}, null, true);
|
|
})();
|