update : check duplicatedArticle description
This commit is contained in:
parent
f35be468f1
commit
9cb32de511
26
index.js
26
index.js
|
|
@ -100,15 +100,36 @@ async function captureComplexArticles(complex) {
|
||||||
const description =
|
const description =
|
||||||
item.representativeArticleInfo.articleDetail.articleFeatureDescription ??
|
item.representativeArticleInfo.articleDetail.articleFeatureDescription ??
|
||||||
"";
|
"";
|
||||||
console.log(dealPrice, description);
|
let duplicatedDescription = [];
|
||||||
const dongName = item.representativeArticleInfo.dongName;
|
const dongName = item.representativeArticleInfo.dongName;
|
||||||
|
|
||||||
|
if (item.duplicatedArticleInfo !== undefined) {
|
||||||
|
duplicatedDescription = item.duplicatedArticleInfo.articleInfoList.map(
|
||||||
|
(al) => al.articleDetail.articleFeatureDescription
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const descriptionIsPass = FILTERS.keywords.some((keyword) => {
|
||||||
|
return duplicatedDescription.some((desc) => {
|
||||||
|
if (desc === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return desc.includes(keyword);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log(
|
||||||
|
dealPrice,
|
||||||
|
description,
|
||||||
|
duplicatedDescription,
|
||||||
|
descriptionIsPass
|
||||||
|
);
|
||||||
|
|
||||||
const useTarget = target.length === 0 ? true : target.includes(dongName);
|
const useTarget = target.length === 0 ? true : target.includes(dongName);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
dealPrice > FILTERS.minPrice &&
|
dealPrice > FILTERS.minPrice &&
|
||||||
dealPrice <= FILTERS.maxPrice &&
|
dealPrice <= FILTERS.maxPrice &&
|
||||||
description.includes(FILTERS.keywords) &&
|
(description.includes(FILTERS.keywords) || descriptionIsPass) &&
|
||||||
supplySpace >= FILTERS.minSupplySpace &&
|
supplySpace >= FILTERS.minSupplySpace &&
|
||||||
useTarget
|
useTarget
|
||||||
);
|
);
|
||||||
|
|
@ -161,6 +182,7 @@ async function main() {
|
||||||
description:
|
description:
|
||||||
article.representativeArticleInfo.articleDetail
|
article.representativeArticleInfo.articleDetail
|
||||||
.articleFeatureDescription,
|
.articleFeatureDescription,
|
||||||
|
|
||||||
// url: `https://fin.land.naver.com/complexes/${complex.complexId}/articles/${article.representativeArticleInfo.articleNo}`,
|
// url: `https://fin.land.naver.com/complexes/${complex.complexId}/articles/${article.representativeArticleInfo.articleNo}`,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue