mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
feat: add chouti top, close #3605
This commit is contained in:
@@ -256,6 +256,22 @@ pageClass: routes
|
||||
|
||||
<Route author="kt286" example="/bishijie/kuaixun" path="/bishijie/kuaixun"/>
|
||||
|
||||
## 抽屉新热榜
|
||||
|
||||
### 最新
|
||||
|
||||
<Route author="xyqfer" example="/chouti/hot" path="/chouti/:subject?" :paramsDesc="['主题名称']">
|
||||
|
||||
| 热榜 | 42 区 | 段子 | 图片 | 挨踢 1024 | 你问我答 |
|
||||
| ---- | ----- | ----- | ---- | --------- | -------- |
|
||||
| hot | news | scoff | pic | tec | ask |
|
||||
|
||||
</Route>
|
||||
|
||||
### 最热榜 TOP10
|
||||
|
||||
<Route author="DIYgod" example="/chouti/top/24" path="/chouti/top/:hour?" :paramsDesc="['排行榜周期,可选 24 72 168 三种,默认 24']" />
|
||||
|
||||
## 创业邦
|
||||
|
||||
### 作者
|
||||
|
||||
@@ -213,23 +213,12 @@ type 为 all 时,category 参数不支持 cost 和 free
|
||||
|
||||
<Route author="LogicJake" example="/kpmg/insights" path="/kpmg/insights" />
|
||||
|
||||
## 抽屉
|
||||
|
||||
### 新热榜
|
||||
|
||||
<Route author="xyqfer" example="/chouti/hot" path="/chouti/:subject?" :paramsDesc="['主题名称']">
|
||||
|
||||
| 热榜 | 42 区 | 段子 | 图片 | 挨踢 1024 | 你问我答 |
|
||||
| ---- | ----- | ----- | ---- | --------- | -------- |
|
||||
| hot | news | scoff | pic | tec | ask |
|
||||
|
||||
</Route>
|
||||
|
||||
## 电鸭社区
|
||||
|
||||
### 工作机会
|
||||
|
||||
<Route author="sfyumi" example="/eleduck/jobs" path="/eleduck/jobs"/>
|
||||
|
||||
## 福利资源-met.red
|
||||
|
||||
### 福利资源-met.red
|
||||
|
||||
@@ -843,6 +843,7 @@ router.get('/dgtle/trade/:typeId?', require('./routes/dgtle/trade'));
|
||||
router.get('/dgtle/trade/search/:keyword', require('./routes/dgtle/keyword'));
|
||||
|
||||
// 抽屉新热榜
|
||||
router.get('/chouti/top/:hour?', require('./routes/chouti/top'));
|
||||
router.get('/chouti/:subject?', require('./routes/chouti'));
|
||||
|
||||
// 西安电子科技大学
|
||||
|
||||
28
lib/routes/chouti/top.js
Normal file
28
lib/routes/chouti/top.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const hour = ctx.params.hour || '24';
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `https://dig.chouti.com/top/${hour}hr?_=${+new Date()}`,
|
||||
headers: {
|
||||
Referer: 'https://dig.chouti.com/',
|
||||
},
|
||||
});
|
||||
|
||||
const resultItem = response.data.data.map((item) => ({
|
||||
title: item.title,
|
||||
author: item.nick,
|
||||
description: `${item.title}<br><img src="${item.originalImgUrl || item.imgUrl || item.original_img_url || item.img_url}" /><br><a href="https://dig.chouti.com/link/${item.id}">评论</a>`,
|
||||
link: item.url,
|
||||
pubDate: new Date(item.createdTime / 1000).toUTCString(),
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
title: `抽屉新热榜-${hour}小时最热榜`,
|
||||
description: '抽屉新热榜,汇聚每日搞笑段子、热门图片、有趣新闻。它将微博、门户、社区、bbs、社交网站等海量内容聚合在一起,通过用户推荐生成最热榜单。看抽屉新热榜,每日热门、有趣资讯尽收眼底。',
|
||||
link: 'https://dig.chouti.com/',
|
||||
item: resultItem,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user