From adf40af494d9b7b09167a1a16fcccdbf7a2e1a2d Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Tue, 26 Sep 2023 19:17:31 +0800 Subject: [PATCH] fix(route): fix author field for ft.com (#13400) --- lib/v2/ft/myft.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/v2/ft/myft.js b/lib/v2/ft/myft.js index f7bd3aa92522bb..fbb87baf84b74b 100644 --- a/lib/v2/ft/myft.js +++ b/lib/v2/ft/myft.js @@ -28,8 +28,14 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); item.description = ProcessFeed($('article.js-article__content-body')); - item.category = JSON.parse($('script[type="application/ld+json"]').eq(1).text()).itemListElement.map((e) => e.name); - item.author = $('a.n-content-tag--author').text(); + item.category = [$('.n-content-tag--with-follow').text()].concat( + $('.article__right-bottom a.concept-list__concept') + .map((i, e) => $(e).text().trim()) + .get() + ); + item.author = $('a.n-content-tag--author') + .map((i, e) => $(e).text()) + .get(); return item; })