From 9cb32de511034c30a76df1c4e6f65a5af7f031bf Mon Sep 17 00:00:00 2001 From: Horoli Date: Tue, 11 Nov 2025 11:42:41 +0900 Subject: [PATCH] update : check duplicatedArticle description --- index.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a1c726c..798f476 100644 --- a/index.js +++ b/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}`, }; }),