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