diff --git a/docs/README.md b/docs/README.md index e05f613e3a..ae1a41badc 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 e5d1aa6429..f42f29928f 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 0000000000..fbe6eea98b --- /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}`, + })), + }; +};