1
0

initial commit

This commit is contained in:
2025-08-07 00:17:31 +02:00
commit 47a7c73316
11 changed files with 2676 additions and 0 deletions

22
cron-runner.js Normal file
View File

@@ -0,0 +1,22 @@
const cron = require('node-cron');
const { exec } = require('child_process');
function runScraper() {
console.log('Running scraper...');
exec('node scrape/scraper.js', (error, stdout, stderr) => {
if (error) {
console.error(`Scraper error: ${error.message}`);
return;
}
if (stderr) console.error(`Scraper stderr: ${stderr}`);
if (stdout) console.log(`Scraper output:\n${stdout}`);
});
}
// Run immediately at start
runScraper();
// Schedule to run every 10 minutes
cron.schedule('*/10 * * * *', runScraper);
console.log('Cron scheduler started. Scraper will run every 10 minutes.');