mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
feat: add nga recommend (#3736)
This commit is contained in:
@@ -28,7 +28,7 @@ pageClass: routes
|
||||
|
||||
### 分区帖子
|
||||
|
||||
<Route author="xyqfer" example="/nga/forum/489" path="/nga/forum/:fid" :paramsDesc="['分区 id, 可在分区主页 URL 找到']" radar="1"/>
|
||||
<Route author="xyqfer" example="/nga/forum/489" path="/nga/forum/:fid/:recommend?" :paramsDesc="['分区 id, 可在分区主页 URL 找到','是否只显示精华主题, 留空为否, 任意值为是']" radar="1"/>
|
||||
|
||||
### 帖子
|
||||
|
||||
|
||||
@@ -989,7 +989,7 @@ router.get('/weseepro/circle', require('./routes/weseepro/circle'));
|
||||
router.get('/coolbuy/newest', require('./routes/coolbuy/newest'));
|
||||
|
||||
// NGA
|
||||
router.get('/nga/forum/:fid', require('./routes/nga/forum'));
|
||||
router.get('/nga/forum/:fid/:recommend?', require('./routes/nga/forum'));
|
||||
router.get('/nga/post/:tid', require('./routes/nga/post'));
|
||||
|
||||
// Nautilus
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { fid } = ctx.params;
|
||||
const { fid, recommend } = ctx.params;
|
||||
const formatContent = (content) =>
|
||||
content
|
||||
.replace(/\[img\](.+?)\[\/img\]/g, (match, p1) => {
|
||||
@@ -18,9 +18,12 @@ module.exports = async (ctx) => {
|
||||
form: true,
|
||||
data: {
|
||||
fid,
|
||||
recommend: recommend ? 1 : 0,
|
||||
},
|
||||
});
|
||||
|
||||
const forumname = homePage.data.forumname;
|
||||
|
||||
const list = homePage.data.result.data.filter(({ tid }) => tid);
|
||||
|
||||
const resultItem = await Promise.all(
|
||||
@@ -55,7 +58,7 @@ module.exports = async (ctx) => {
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `NGA-${fid}`,
|
||||
title: `NGA - ${forumname}`,
|
||||
link: `https://nga.178.com/thread.php?fid=${fid}`,
|
||||
description: 'NGA是国内专业的游戏玩家社区,魔兽世界,英雄联盟,炉石传说,风暴英雄,暗黑破坏神3(D3)游戏攻略讨论,以及其他热门游戏玩家社区',
|
||||
item: resultItem,
|
||||
|
||||
Reference in New Issue
Block a user