This commit is contained in:
Nick Leeman 2021-03-26 15:04:55 +01:00
parent 7b050cbfaa
commit 8e52c437ef

View File

@ -34,15 +34,15 @@ import {
Coolblue
} from "./modules/websites";
start();
// debugStart();
// Globals
let browser: puppeteer.Browser = null;
let sitemapUrl: string = "";
let allProducts: Array<any> = [];
let allBlogUrls: Array<any> = [];
// debugStart();
start();
async function debugStart() {
browser = await puppeteer.launch({ headless: false });
console.log(await crawlProductStock("https://www.coolblue.nl/product/829953/cardo-scala-rider-freecom-4-plus-single.html"));
@ -294,9 +294,9 @@ async function generateReport() {
console.log("Generating report...");
let today: Date = new Date();
let datecode: string = today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDay().toString();
let datecode: string = today.getFullYear().toString() + "-" + (today.getMonth() + 1).toString() + "-" + today.getDay().toString();
let domain: string = getDomain(sitemapUrl);
let file = `${domain}-${datecode}-report.txt`;
let file = `${domain}_${datecode}_report.txt`;
let totalProducts = 0;
let totalOutStock = 0;