mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
@@ -3169,3 +3169,7 @@ type 为 all 时,category 参数不支持 cost 和 free
|
||||
<route name="主页" author="SettingDust" example="/uraaka-joshi" path="/uraaka-joshi"/>
|
||||
|
||||
<route name="用户" author="SettingDust" example="/uraaka-joshi/_rrwq" path="/uraaka-joshi/:id" :paramsDesc="['用户名']"/>
|
||||
|
||||
### 今日热榜
|
||||
|
||||
<route name="榜单" author="LogicJake" example="/tophub/Om4ejxvxEN" path="/tophub/:id" :paramsDesc="['榜单id,可在 URL 中找到']"/>
|
||||
|
||||
@@ -1145,6 +1145,9 @@ router.get('/blogs/jingwei.link', require('./routes/blogs/jingwei_link'));
|
||||
router.get('/uraaka-joshi', require('./routes/uraaka-joshi/uraaka-joshi'));
|
||||
router.get('/uraaka-joshi/:id', require('./routes/uraaka-joshi/uraaka-joshi-user'));
|
||||
|
||||
// 今日热榜
|
||||
router.get('/tophub/:id', require('./routes/tophub'));
|
||||
|
||||
// 游戏时光
|
||||
router.get('/vgtime/news', require('./routes/vgtime/news.js'));
|
||||
router.get('/vgtime/release', require('./routes/vgtime/release'));
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
const axios = require('../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id;
|
||||
|
||||
const link = `https://tophub.today/n/${id}`;
|
||||
const response = await axios.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const title = $('div.Xc-ec-L.b-L')
|
||||
.text()
|
||||
.trim();
|
||||
|
||||
const out = $('div.Zd-p-Sc > div:nth-child(1) tr')
|
||||
.map(function() {
|
||||
const info = {
|
||||
title: $(this)
|
||||
.find('td.al a')
|
||||
.text(),
|
||||
link: $(this)
|
||||
.find('td.al a')
|
||||
.attr('href'),
|
||||
};
|
||||
return info;
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: title,
|
||||
link: link,
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user