feat: 新增前端艺术家每日资讯&飞冰早报 (#2903)

This commit is contained in:
kouchao
2019-08-21 14:38:24 +08:00
committed by DIYgod
parent a517649a36
commit 3fc793008b
3 changed files with 36 additions and 0 deletions

View File

@@ -499,6 +499,18 @@ GitHub 官方也提供了一些 RSS:
</Route>
## 前端艺术家&&飞冰早报
### 列表
<Route author="kouchao" example="/jskou/0" path="/jskou/:type?" :paramsDesc="['分类']">
| 前端艺术家 | 飞冰早报 |
| ---------- | -------- |
| 0 | 1 |
</Route>
## 顺丰
### 顺丰丰桥开放平台公告

View File

@@ -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;

21
lib/routes/jskou/index.js Normal file
View File

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