From 3fc793008b18e8388a06fafa408131a394d95fbf Mon Sep 17 00:00:00 2001 From: kouchao <1396726559@qq.com> Date: Wed, 21 Aug 2019 14:38:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E8=89=BA=E6=9C=AF=E5=AE=B6=E6=AF=8F=E6=97=A5=E8=B5=84=E8=AE=AF?= =?UTF-8?q?&=E9=A3=9E=E5=86=B0=E6=97=A9=E6=8A=A5=20(#2903)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/programming.md | 12 ++++++++++++ lib/router.js | 3 +++ lib/routes/jskou/index.js | 21 +++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 lib/routes/jskou/index.js diff --git a/docs/programming.md b/docs/programming.md index 44b0140d4..c8d2a6cea 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -499,6 +499,18 @@ GitHub 官方也提供了一些 RSS: +## 前端艺术家&&飞冰早报 + +### 列表 + + + +| 前端艺术家 | 飞冰早报 | +| ---------- | -------- | +| 0 | 1 | + + + ## 顺丰 ### 顺丰丰桥开放平台公告 diff --git a/lib/router.js b/lib/router.js index bbbedbcbc..45015a223 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1637,4 +1637,7 @@ router.get('/latexstudio/home', require('./routes/latexstudio/home')); // 上证债券信息网 - 可转换公司债券公告 router.get('/sse/convert/:query?', require('./routes/sse/convert')); +// 前端艺术家每日整理&&飞冰早报 +router.get('/jskou/:type?', require('./routes/jskou/index')); + module.exports = router; diff --git a/lib/routes/jskou/index.js b/lib/routes/jskou/index.js new file mode 100644 index 000000000..606e6e75f --- /dev/null +++ b/lib/routes/jskou/index.js @@ -0,0 +1,21 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const type = ctx.params.type; + const response = await got(`http://jskou.com:3003/contents/list?type=${type || 0}&page=0&pageSize=30`); + const item = response.data.data.map((item) => { + const tag = item.tag ? `[${item.tag}]` : ''; + return { + title: item.title, + description: `${tag} ${item.title}`, + pubDate: item.time, + link: item.link, + }; + }); + ctx.state.data = { + title: type ? '前端艺术家每日资讯整理' : '飞冰早报整理', + link: 'http://fe.jskou.com/', + description: '前端艺术家1群每日资讯,飞冰早报', + item, + }; +};