diff --git a/app/crawler/specificCrawlers/saljic.js b/app/crawler/specificCrawlers/saljic.js index 37c569e..267dcde 100644 --- a/app/crawler/specificCrawlers/saljic.js +++ b/app/crawler/specificCrawlers/saljic.js @@ -218,7 +218,7 @@ class SaljicCrawler { } async scrapeAd(url, adType) { - console.log("[SALJIC] Scraping : ", url); + // console.log("[SALJIC] Scraping : ", url); try { const adPageSource = await fetch(url); const body = await adPageSource.text(); @@ -543,7 +543,6 @@ class SaljicCrawler { distanceToRiver, numberOfViewsAgency }; - console.log(data); return data; } catch (e) { console.error("Exception caught: " + e.message, "\r\nURL:", url); diff --git a/app/helpers/emailContentGenerator.js b/app/helpers/emailContentGenerator.js index a233ff2..d201e8f 100644 --- a/app/helpers/emailContentGenerator.js +++ b/app/helpers/emailContentGenerator.js @@ -34,11 +34,6 @@ const generateNotificationEmail = ( noAllRealEstates, dailyNotification = false ) => { - //DEBUGGING - console.log( - "[DEBUGGING] Function generateNotificationEmail-noAllRealEstates:", - noAllRealEstates - ); const truncateList = realEstates.length > MAX_REAL_ESTATES_IN_EMAIL; const realEstatesToShow = truncateList @@ -65,8 +60,7 @@ const generateNotificationEmail = ( : "U posljednja 24h objavljena je sljedeća nekretnina koja odgovara uslovima Vaše pretrage"; const messageBody = dailyNotification ? dailyMessageBody : asapMessageBody; - //DEBUGGING - console.log("[DEBUGGING]: Function generateNotificationEmail-", stagingTag); + return `

${stagingTag}Zdravo

${messageBody}

@@ -126,12 +120,6 @@ const generateNewSearchRequestEmail = (searchRequest, matchingRealEstates) => { const emailFooter = generateEmailFooter(id, emailFrequencyTitle); - //DEBUGGING - console.log( - "[DEBUGGING]: Function generateNewSearchRequestEmail-", - stagingTag - ); - return `

${stagingTag}Zdravo

Naručili ste da Vam javimo ako se nekretnina sa navedenim uslovima pojavi u oglasima:

@@ -148,9 +136,6 @@ const generateNewSearchRequestEmail = (searchRequest, matchingRealEstates) => { }; const generateEmailSubject = (numberOfRealEstates, singleRealEstateTitle) => { - //DEBUGGING - console.log("[DEBUGGING]: Function generateEmailSubject-", stagingTag); - if (numberOfRealEstates === 1) { return `${stagingTag}Kivi: ${singleRealEstateTitle}`; } diff --git a/app/services/notificationService.js b/app/services/notificationService.js index e9d7283..692effd 100644 --- a/app/services/notificationService.js +++ b/app/services/notificationService.js @@ -21,8 +21,6 @@ const { const { sendEmail } = require("../services/emailService"); const notifyForNewRealEstates = async newRealEstates => { - // - console.log("[DEBUGGING] Function notifyForNewRealEstates started."); const matches = await matchRealEstates(newRealEstates); await notifyMatches(matches); }; @@ -37,8 +35,7 @@ const notifyForNewSearchRequest = async searchRequest => { matchingRealEstates ); const { email } = searchRequest; - //DEBUGGING - console.log("[DEBUGGING]: Function notifyForNewSearchRequest-", stagingTag); + await sendEmail( email, `${stagingTag} Kivi - novi zahtjev za pretragu`, @@ -48,17 +45,12 @@ const notifyForNewSearchRequest = async searchRequest => { const notifyMatches = async (matches, dailyNotification = false) => { const searchRequestsToNotify = Object.keys(matches); - // - console.log("[DEBUGGING] Function notifyMatches started."); const asyncSendEmailActions = []; for (const id of searchRequestsToNotify) { const { searchRequest, notifyNow } = matches[id]; const { email, subscribed } = searchRequest; if (notifyNow && subscribed) { - // - console.log("[DEBUGGING] Function notifyMatches - if statement true."); - const allMatchingRealEstates = matches[id].realEstates || []; //Variable allMatchingRealEstates are real estates that are "new" on the market @@ -66,11 +58,6 @@ const notifyMatches = async (matches, dailyNotification = false) => { //New variable allRealEstates are all real estates that exists in db for search req const allRealEstates = await findRealEstatesForSearchRequest(id); const noAllRealEstates = allRealEstates.length; - //DEBUGGING - console.log( - "[DEBUGGING] Function notifyMatches-noAllRealEstates:", - noAllRealEstates - ); if (allMatchingRealEstates.length > 0) { const emailContent = generateNotificationEmail(