From acfcd0cafc22b6d470d6f46802d65d64f1d585b7 Mon Sep 17 00:00:00 2001 From: Kawauso Date: Mon, 5 Feb 2024 19:46:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(route):=20Optimize=20the=20title=20of=20Ca?= =?UTF-8?q?ixin=20Weekly=20|=20=E4=BC=98=E5=8C=96=E3=80=8A=E8=B4=A2?= =?UTF-8?q?=E6=96=B0=E5=91=A8=E5=88=8A=E3=80=8B=E6=A0=87=E9=A2=98=20(#1439?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 优化标题 * feat(route): Optimize the title of Caixin Weekly --- lib/v2/caixin/weekly.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/v2/caixin/weekly.js b/lib/v2/caixin/weekly.js index 4b90ce96f..8cf12cfcb 100644 --- a/lib/v2/caixin/weekly.js +++ b/lib/v2/caixin/weekly.js @@ -27,7 +27,7 @@ module.exports = async (ctx) => { const { data } = await got(item.link); const $ = cheerio.load(data); - item.title = $('head title').text(); + item.title = $('head title').text().replace(/_财新周刊频道_财新网$/, '').trim(); item.pubDate = parseDate( $('.source') .text() @@ -47,7 +47,7 @@ module.exports = async (ctx) => { ); ctx.state.data = { - title: $('head title').text(), + title: $('head title').text().replace(/_财新周刊频道_财新网$/, '').trim(), link, item: items, };