Add 果壳网 -- 科学人

This commit is contained in:
alphardex 2018-08-30 10:27:24 +08:00
parent bd7fed402d
commit c63bc20894
4 changed files with 36 additions and 2 deletions

View File

@ -280,6 +280,8 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇
- 上海微系统与信息技术研究所学术活动
- ifanr
- AppSolution
- 果壳网
- 科学人
</details>
@ -320,9 +322,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)
### 参与讨论

View File

@ -2266,3 +2266,13 @@ type分类
路由: `/ifanr/appso`
参数: 无
## 果壳网 guokr <Author uid="alphardex"/>
### 科学人
举例: <https://rsshub.app/guokr/scientific>
路由: `/guokr/scientific`
参数: 无

19
guokr/scientific.js Normal file
View File

@ -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<br><img referrerpolicy="no-referrer" src="${item.image_info.url}">`,
pubDate: item.date_published,
link: item.url
}))
};
};

View File

@ -488,4 +488,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;