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, + }; +};