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}`, }; }),