mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-28 03:28:35 +08:00
feat: 礼物说 (#2716)
* fix: fix afdian link error * feat: 礼物说 * revoke afdian change * fix: liwushuo error link
This commit is contained in:
@@ -42,6 +42,12 @@ pageClass: routes
|
||||
|
||||
</Route>
|
||||
|
||||
## 礼物说
|
||||
|
||||
### 礼物说
|
||||
|
||||
<Route author="sanmmm" example="/liwushuo/index" path="/liwushuo/index"/>
|
||||
|
||||
## 什么值得买
|
||||
|
||||
::: tip 提示
|
||||
|
||||
@@ -1586,4 +1586,7 @@ router.get('/nogizaka46/news', require('./routes/nogizaka46/news'));
|
||||
// 阿里云
|
||||
router.get('/aliyun/database_month', require('./routes/aliyun/database_month'));
|
||||
|
||||
// 礼物说
|
||||
router.get('/liwushuo/index', require('./routes/liwushuo/index.js'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const baseUrl = 'https://www.liwushuo.com';
|
||||
const link = `${baseUrl}/api/channels/1/items`;
|
||||
const res = await got(link, {
|
||||
query: {
|
||||
limit: 21,
|
||||
},
|
||||
});
|
||||
|
||||
const item = res.data.data.items.map((item) => {
|
||||
const { content_url, cover_image_url, created_at, share_msg, title } = item;
|
||||
return {
|
||||
title,
|
||||
link: content_url,
|
||||
pubDate: new Date(created_at * 1000).toUTCString(),
|
||||
description: [`<img src="${cover_image_url}"/>`, share_msg].join('<br/>'),
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: '礼物说 - 精选',
|
||||
description: '礼物说 - 精选',
|
||||
link: baseUrl,
|
||||
item,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user