fix(route): fix author field for ft.com (#13400)

This commit is contained in:
Andvari 2023-09-26 19:17:31 +08:00 committed by GitHub
parent 143a42f14a
commit adf40af494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -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;
})