diff --git a/README.md b/README.md index e97d45fe67..4a10d2b8f5 100644 --- a/README.md +++ b/README.md @@ -281,6 +281,8 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇 - 上海微系统与信息技术研究所学术活动 - ifanr - AppSolution +- 果壳网 + - 科学人 @@ -321,9 +323,9 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇 1. 在 [/router.js](https://github.com/DIYgod/RSSHub/blob/master/router.js) 里添加路由 -1. 在 [/routes/](https://github.com/DIYgod/RSSHub/tree/master/routes) 中的路由对应路径添加获取 RSS 内容的脚本 +2. 在 [/routes/](https://github.com/DIYgod/RSSHub/tree/master/routes) 中的路由对应路径添加获取 RSS 内容的脚本 -1. 更新 README 和文档: [/README.md](https://github.com/DIYgod/RSSHub/blob/master/README.md) [/docs/README.md](https://github.com/DIYgod/RSSHub/blob/master/docs/README.md) +3. 更新 README 和文档: [/README.md](https://github.com/DIYgod/RSSHub/blob/master/README.md) [/docs/README.md](https://github.com/DIYgod/RSSHub/blob/master/docs/README.md) ### 参与讨论 diff --git a/docs/README.md b/docs/README.md index fdd9beead6..8b566d153e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2496,3 +2496,13 @@ ISO 3166-1 国家代码列表请参见 [维基百科 ISO_3166-1](https://zh.wiki 路由: `/ifanr/appso` 参数: 无 + +## 果壳网 guokr + +### 科学人 + +举例: + +路由: `/guokr/scientific` + +参数: 无 diff --git a/router.js b/router.js index 6d90421a3d..56a85daf34 100755 --- a/router.js +++ b/router.js @@ -490,4 +490,7 @@ router.get('/cas/sim/academic', require('./routes/cas/sim/academic')); // ifanr router.get('/ifanr/appso', require('./routes/ifanr/appso')); +// 果壳网 +router.get('/guokr/scientific', require('./routes/guokr/scientific')); + module.exports = router; diff --git a/routes/guokr/scientific.js b/routes/guokr/scientific.js new file mode 100644 index 0000000000..340b286486 --- /dev/null +++ b/routes/guokr/scientific.js @@ -0,0 +1,19 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios.get('https://www.guokr.com/apis/minisite/article.json?retrieve_type=by_subject&limit=20&offset=0'); + + const result = response.data.result; + + ctx.state.data = { + 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, + })), + }; +};