mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: 简阅(simpread) notice
This commit is contained in:
@@ -433,3 +433,9 @@ pageClass: routes
|
||||
| | -commentCount | -createdAt | createdAt |
|
||||
|
||||
</Route>
|
||||
|
||||
## simpread
|
||||
|
||||
### 消息通知
|
||||
|
||||
<Route author="zytomorrow" example="/simpread/notice" path="/yuanliao/notice">
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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',
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user