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 =
|
||||
item.representativeArticleInfo.articleDetail.articleFeatureDescription ??
|
||||
"";
|
||||
console.log(dealPrice, description);
|
||||
let duplicatedDescription = [];
|
||||
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);
|
||||
|
||||
return (
|
||||
dealPrice > FILTERS.minPrice &&
|
||||
dealPrice <= FILTERS.maxPrice &&
|
||||
description.includes(FILTERS.keywords) &&
|
||||
(description.includes(FILTERS.keywords) || descriptionIsPass) &&
|
||||
supplySpace >= FILTERS.minSupplySpace &&
|
||||
useTarget
|
||||
);
|
||||
|
|
@ -161,6 +182,7 @@ async function main() {
|
|||
description:
|
||||
article.representativeArticleInfo.articleDetail
|
||||
.articleFeatureDescription,
|
||||
|
||||
// url: `https://fin.land.naver.com/complexes/${complex.complexId}/articles/${article.representativeArticleInfo.articleNo}`,
|
||||
};
|
||||
}),
|
||||
|
|
|
|||
Loading…
Reference in New Issue