From 8a87b9e2539bdaae38e056a8cf46626df2751731 Mon Sep 17 00:00:00 2001 From: Naida Vatric Date: Sat, 8 Feb 2020 00:27:26 +0100 Subject: [PATCH] Another fix. --- app/crawler/specificCrawlers/saljic.js | 31 ++++++++++++++++++-------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/app/crawler/specificCrawlers/saljic.js b/app/crawler/specificCrawlers/saljic.js index 7e445d6..b580c9c 100644 --- a/app/crawler/specificCrawlers/saljic.js +++ b/app/crawler/specificCrawlers/saljic.js @@ -327,6 +327,11 @@ class SaljicCrawler { let numberOfViewsKivi = null; let streetNumber = 0; let adStatus = status; + let shortDescription = descriptions.substring( + 0, + descriptions.indexOf(".") + ); + let longDescription = descriptions; //Extracting data - Glavne karakteristike let mainFieldIndex = 1; do { @@ -485,26 +490,34 @@ class SaljicCrawler { renewedDate = new Date(); } + const originAgencyName = AD_AGENCY.SALJIC; + const locality = ""; + const municipality = ""; + const city = ""; + const region = ""; + const entity = ""; + const country = ""; + const data = { url, agencyObjectId, - originAgencyName: AD_AGENCY.SALJIC, + originAgencyName, realEstateType, adType, title, price, area, gardenSize, - shortDescription: descriptions.substring(0, descriptions.indexOf(".")), - longDescription: descriptions, + shortDescription, + longDescription, streetNumber, streetName, - locality: "", - municipality: "", - city: "", - region: "", - entity: "", - country: "", + locality, + municipality, + city, + region, + entity, + country, locationLat, locationLong, adStatus,