feat: 简阅(simpread) notice

This commit is contained in:
zytomorrow
2021-01-06 15:49:58 +08:00
parent 9ebadfd676
commit 8cc0dfa231
3 changed files with 29 additions and 0 deletions
+6
View File
@@ -433,3 +433,9 @@ pageClass: routes
| | -commentCount | -createdAt | createdAt |
</Route>
## simpread
### 消息通知
<Route author="zytomorrow" example="/simpread/notice" path="/yuanliao/notice">
+3
View File
@@ -3780,4 +3780,7 @@ router.get('/nace/blog/:sort?', require('./routes/nace/blog'));
// Caixin Latest
router.get('/caixin/latest', require('./routes/caixin/latest'));
// SimpRead
router.get('/simpread/notice', require('./routes/simpread/notice'));
module.exports = router;
+20
View File
@@ -0,0 +1,20 @@
const got = require('@/utils/got');
const md = require('markdown-it')();
module.exports = async (ctx) => {
const url = 'https://static.simp.red/notice';
const response = await got.get(url);
const data = response.data.notice;
ctx.state.data = {
title: 'SimpRead 消息通知',
link: url,
description: 'SimpRead 消息通知',
item: data.map((item) => ({
description: md.render(item.content),
link: url,
pubDate: item.date,
title: `${item.category.name}-${item.title}`,
author: 'SimpRead',
})),
};
};