From 2ed61206a74aec1e289ba17e5a49a8103c4d4a7d Mon Sep 17 00:00:00 2001 From: Cloud Date: Mon, 14 Sep 2020 23:55:27 +0800 Subject: [PATCH] fix: oschina (#5663) --- lib/routes/oschina/news.js | 4 ++-- lib/routes/oschina/u.js | 2 +- lib/routes/oschina/user.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/routes/oschina/news.js b/lib/routes/oschina/news.js index 32d2edff7..86b4d9efd 100644 --- a/lib/routes/oschina/news.js +++ b/lib/routes/oschina/news.js @@ -80,8 +80,8 @@ module.exports = async (ctx) => { }); const content = cheerio.load(detail.data); content('.ad-wrap').remove(); - item.description = content('#articleContent').html(); - item.author = content('a.__user').find('span').text(); + item.description = content('.article-detail').html(); + item.author = content('.article-box__meta .item').first().text(); ctx.cache.set(key, item.description); } } diff --git a/lib/routes/oschina/u.js b/lib/routes/oschina/u.js index 7f13152f6..2e3b6179e 100644 --- a/lib/routes/oschina/u.js +++ b/lib/routes/oschina/u.js @@ -42,7 +42,7 @@ module.exports = async (ctx) => { }); const content = cheerio.load(detail.data); content('#articleContent .ad-wrap').remove(); - item.description = content('#articleContent').html(); + item.description = content('.article-detail').html(); ctx.cache.set(key, item.description); } return Promise.resolve(item); diff --git a/lib/routes/oschina/user.js b/lib/routes/oschina/user.js index b685a66c4..936b4de61 100644 --- a/lib/routes/oschina/user.js +++ b/lib/routes/oschina/user.js @@ -42,7 +42,7 @@ module.exports = async (ctx) => { }); const content = cheerio.load(detail.data); content('.ad-wrap').remove(); - item.description = content('#articleContent').html(); + item.description = content('.article-detail').html(); ctx.cache.set(key, item.description); } return Promise.resolve(item);