From 8e7207c06fb8ecf82627ed3f0172799c4340413a Mon Sep 17 00:00:00 2001 From: Andie Date: Sun, 2 Sep 2018 19:39:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=B3=E5=88=BB=E5=B0=8F=E6=8A=A5=20(#620)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolve https://github.com/DIYgod/RSSHub/issues/618 --- docs/README.md | 8 ++++++++ router.js | 1 + routes/jike/daily.js | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 routes/jike/daily.js diff --git a/docs/README.md b/docs/README.md index e05f613e3..ae1a41bad 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1506,6 +1506,14 @@ GitHub 官方也提供了一些 RSS: - id, 用户 id, 可在即刻 web 端用户页 URL 中找到 +### 即刻小报 + +举例: + +路由: `/jike/daily` + +参数: 无 + ## 微信 ::: tip 提示 diff --git a/router.js b/router.js index e5d1aa642..f42f29928 100755 --- a/router.js +++ b/router.js @@ -233,6 +233,7 @@ if (config.youtube && config.youtube.key) { router.get('/jike/topic/:id', require('./routes/jike/topic')); router.get('/jike/topic/square/:id', require('./routes/jike/topicSquare')); router.get('/jike/user/:id', require('./routes/jike/user')); +router.get('/jike/daily', require('./routes/jike/daily')); // 极客时间 router.get('/geektime/column/:cid', require('./routes/geektime/column')); diff --git a/routes/jike/daily.js b/routes/jike/daily.js new file mode 100644 index 000000000..fbe6eea98 --- /dev/null +++ b/routes/jike/daily.js @@ -0,0 +1,19 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const { + data: { data }, + } = await axios.get('https://app.jike.ruguoapp.com/1.0/dailies/list'); + + ctx.state.data = { + title: '即刻小报', + link: 'https://jike.app/', + description: '不定期呈现的即刻内容精选', + item: data.map((item) => ({ + title: item.title, + description: ``, + pubDate: new Date(item.date).toUTCString(), + link: `https://m.okjike.com/dailies/${item.id}`, + })), + }; +};