mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-15 10:15:23 +08:00
Add 果壳网 -- 科学人 (#595)
* Add 果壳网 -- 科学人 * run 'npm run format' * fix description
This commit is contained in:
@@ -281,6 +281,8 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇
|
|||||||
- 上海微系统与信息技术研究所学术活动
|
- 上海微系统与信息技术研究所学术活动
|
||||||
- ifanr
|
- ifanr
|
||||||
- AppSolution
|
- AppSolution
|
||||||
|
- 果壳网
|
||||||
|
- 科学人
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -321,9 +323,9 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇
|
|||||||
|
|
||||||
1. 在 [/router.js](https://github.com/DIYgod/RSSHub/blob/master/router.js) 里添加路由
|
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)
|
||||||
|
|
||||||
### 参与讨论
|
### 参与讨论
|
||||||
|
|
||||||
|
|||||||
@@ -2496,3 +2496,13 @@ ISO 3166-1 国家代码列表请参见 [维基百科 ISO_3166-1](https://zh.wiki
|
|||||||
路由: `/ifanr/appso`
|
路由: `/ifanr/appso`
|
||||||
|
|
||||||
参数: 无
|
参数: 无
|
||||||
|
|
||||||
|
## 果壳网 guokr <Author uid="alphardex"/>
|
||||||
|
|
||||||
|
### 科学人
|
||||||
|
|
||||||
|
举例: <https://rsshub.app/guokr/scientific>
|
||||||
|
|
||||||
|
路由: `/guokr/scientific`
|
||||||
|
|
||||||
|
参数: 无
|
||||||
|
|||||||
@@ -490,4 +490,7 @@ router.get('/cas/sim/academic', require('./routes/cas/sim/academic'));
|
|||||||
// ifanr
|
// ifanr
|
||||||
router.get('/ifanr/appso', require('./routes/ifanr/appso'));
|
router.get('/ifanr/appso', require('./routes/ifanr/appso'));
|
||||||
|
|
||||||
|
// 果壳网
|
||||||
|
router.get('/guokr/scientific', require('./routes/guokr/scientific'));
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
19
routes/guokr/scientific.js
Normal file
19
routes/guokr/scientific.js
Normal 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,
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user