diff --git a/lib/routes/guokr/scientific.js b/lib/routes/guokr/scientific.js
index 9c8013756..75ffa2c77 100644
--- a/lib/routes/guokr/scientific.js
+++ b/lib/routes/guokr/scientific.js
@@ -1,4 +1,5 @@
const got = require('@/utils/got');
+const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await got.get('https://www.guokr.com/apis/minisite/article.json?retrieve_type=by_subject&limit=20&offset=0');
@@ -9,12 +10,22 @@ module.exports = async (ctx) => {
title: '果壳网 科学人',
link: 'https://www.guokr.com/scientific',
description: '果壳网 科学人',
- item: result.map((item) => ({
- title: item.title,
- description: `${item.summary}
`,
- pubDate: item.date_published,
- link: item.url,
- author: item.author.nickname,
- })),
+ item: await Promise.all(
+ result.map(
+ async (item) =>
+ await ctx.cache.tryGet(item.url, async () => {
+ const res = await got.get(item.url);
+ const $ = cheerio.load(res.data);
+ item.description = $('.eflYNZ #js_content').css('visibility', 'visible').html() || $('.bPfFQI').html();
+ return {
+ title: item.title,
+ description: item.description,
+ pubDate: item.date_published,
+ link: item.url,
+ author: item.author.nickname,
+ };
+ })
+ )
+ ),
};
};