Merge branch 'master' into kivi-original-ads-input

This commit is contained in:
Naida Vatric
2020-02-09 19:19:30 +01:00

View File

@@ -268,6 +268,7 @@ class SaljicCrawler {
const descriptions = $(propertySelectors.descriptions) const descriptions = $(propertySelectors.descriptions)
.text() .text()
.replace(/\"/g, "")
.trim(); .trim();
const latAndLongSrc = $(propertySelectors.latAndLong).attr("src"); const latAndLongSrc = $(propertySelectors.latAndLong).attr("src");
@@ -283,8 +284,8 @@ class SaljicCrawler {
const locationLong = parseFloat(longText) || null; const locationLong = parseFloat(longText) || null;
//====== DETAIL INFORMATION FIELDS ========== //====== DETAIL INFORMATION FIELDS ==========
let area, let area = null,
gardenSize, gardenSize = null,
numberOfRooms = null, numberOfRooms = null,
numberOfFloors = null, numberOfFloors = null,
floor = null, floor = null,
@@ -315,6 +316,7 @@ class SaljicCrawler {
includingBills = null, includingBills = null,
animalsAllowed = null, animalsAllowed = null,
pool = null, pool = null,
exchange = null,
urbanPlanPermit = null, urbanPlanPermit = null,
buildingPermit = null, buildingPermit = null,
utilityConnection = null, utilityConnection = null,
@@ -323,7 +325,14 @@ class SaljicCrawler {
let renewedDate = null; let renewedDate = null;
let realEstateType; let realEstateType;
let numberOfViewsAgency = null; let numberOfViewsAgency = null;
let numberOfViewsKivi = null;
let streetNumber = 0;
let adStatus = status;
let shortDescription = descriptions.substring(
0,
descriptions.indexOf(".")
);
let longDescription = descriptions;
//Extracting data - Glavne karakteristike //Extracting data - Glavne karakteristike
let mainFieldIndex = 1; let mainFieldIndex = 1;
do { do {
@@ -482,29 +491,37 @@ class SaljicCrawler {
renewedDate = new Date(); renewedDate = new Date();
} }
const originAgencyName = AD_AGENCY.SALJIC;
const locality = "";
const municipality = "";
const city = "";
const region = "";
const entity = "";
const country = "";
const data = { const data = {
url, url,
agencyObjectId, agencyObjectId,
originAgencyName: AD_AGENCY.SALJIC, originAgencyName,
realEstateType, realEstateType,
adType, adType,
title, title,
price, price,
area, area,
gardenSize, gardenSize,
shortDescription: descriptions.substring(0, descriptions.indexOf(".")), shortDescription,
longDescription: descriptions, longDescription,
streetNumber: 0, streetNumber,
streetName, streetName,
locality: "", locality,
municipality: "", municipality,
city: "", city,
region: "", region,
entity: "", entity,
country: "", country,
locationLat, locationLat,
locationLong, locationLong,
adStatus: status, adStatus,
publishedDate, publishedDate,
renewedDate, renewedDate,
numberOfRooms, numberOfRooms,
@@ -537,12 +554,15 @@ class SaljicCrawler {
includingBills, includingBills,
animalsAllowed, animalsAllowed,
pool, pool,
exchange,
urbanPlanPermit, urbanPlanPermit,
buildingPermit, buildingPermit,
utilityConnection, utilityConnection,
distanceToRiver, distanceToRiver,
numberOfViewsAgency numberOfViewsAgency,
numberOfViewsKivi
}; };
return data; return data;
} catch (e) { } catch (e) {
console.error("Exception caught: " + e.message, "\r\nURL:", url); console.error("Exception caught: " + e.message, "\r\nURL:", url);