From b9d6383db6e63cdab2e38f305de444e74c00df1b Mon Sep 17 00:00:00 2001 From: tuzi3040 <28290621+tuzi3040@users.noreply.github.com> Date: Thu, 14 Nov 2019 15:21:58 +0800 Subject: [PATCH] fix: japanpost guid (#3422) --- lib/routes/japanpost/index.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/routes/japanpost/index.js b/lib/routes/japanpost/index.js index 78070b6e14..eb4014909e 100644 --- a/lib/routes/japanpost/index.js +++ b/lib/routes/japanpost/index.js @@ -43,10 +43,24 @@ module.exports = async (ctx) => { .map((index, item) => { item = $(item); const itemTd = item.find('td'); - const itemTitle = itemTd.eq(1).text() + ' ' + itemTd.eq(4).text() + ' ' + itemTd.eq(3).text(); + const itemTitle = + itemTd + .eq(1) + .text() + .trim() + + ' ' + + itemTd + .eq(4) + .text() + .trim() + + ' ' + + itemTd + .eq(3) + .text() + .trim(); const itemDescription = itemTd.eq(2).text(); const itemPubDateText = itemTd.eq(0).text(); - const itemGuid = util.generateGuid(itemDescription + itemPubDateText); + const itemGuid = util.generateGuid(itemTitle + itemDescription + itemPubDateText); return { title: itemTitle, description: itemDescription,