From 9547b2992e1fb705469362ee98f9cc55ece77de4 Mon Sep 17 00:00:00 2001
From: Nameless God <2582347430@qq.com>
Date: Thu, 30 Aug 2018 22:03:27 +0800
Subject: [PATCH] =?UTF-8?q?Add=20=E6=9E=9C=E5=A3=B3=E7=BD=91=20--=20?=
=?UTF-8?q?=E7=A7=91=E5=AD=A6=E4=BA=BA=20(#595)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Add 果壳网 -- 科学人
* run 'npm run format'
* fix description
---
README.md | 6 ++++--
docs/README.md | 10 ++++++++++
router.js | 3 +++
routes/guokr/scientific.js | 19 +++++++++++++++++++
4 files changed, 36 insertions(+), 2 deletions(-)
create mode 100644 routes/guokr/scientific.js
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,
+ })),
+ };
+};