mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-11 07:40:26 +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'));
|
router.get('/coolbuy/newest', require('./routes/coolbuy/newest'));
|
||||||
|
|
||||||
// NGA
|
// 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'));
|
router.get('/nga/post/:tid', require('./routes/nga/post'));
|
||||||
|
|
||||||
// Nautilus
|
// Nautilus
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const got = require('@/utils/got');
|
const got = require('@/utils/got');
|
||||||
|
|
||||||
module.exports = async (ctx) => {
|
module.exports = async (ctx) => {
|
||||||
const { fid } = ctx.params;
|
const { fid, recommend } = ctx.params;
|
||||||
const formatContent = (content) =>
|
const formatContent = (content) =>
|
||||||
content
|
content
|
||||||
.replace(/\[img\](.+?)\[\/img\]/g, (match, p1) => {
|
.replace(/\[img\](.+?)\[\/img\]/g, (match, p1) => {
|
||||||
@@ -18,9 +18,12 @@ module.exports = async (ctx) => {
|
|||||||
form: true,
|
form: true,
|
||||||
data: {
|
data: {
|
||||||
fid,
|
fid,
|
||||||
|
recommend: recommend ? 1 : 0,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const forumname = homePage.data.forumname;
|
||||||
|
|
||||||
const list = homePage.data.result.data.filter(({ tid }) => tid);
|
const list = homePage.data.result.data.filter(({ tid }) => tid);
|
||||||
|
|
||||||
const resultItem = await Promise.all(
|
const resultItem = await Promise.all(
|
||||||
@@ -55,7 +58,7 @@ module.exports = async (ctx) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
ctx.state.data = {
|
ctx.state.data = {
|
||||||
title: `NGA-${fid}`,
|
title: `NGA - ${forumname}`,
|
||||||
link: `https://nga.178.com/thread.php?fid=${fid}`,
|
link: `https://nga.178.com/thread.php?fid=${fid}`,
|
||||||
description: 'NGA是国内专业的游戏玩家社区,魔兽世界,英雄联盟,炉石传说,风暴英雄,暗黑破坏神3(D3)游戏攻略讨论,以及其他热门游戏玩家社区',
|
description: 'NGA是国内专业的游戏玩家社区,魔兽世界,英雄联盟,炉石传说,风暴英雄,暗黑破坏神3(D3)游戏攻略讨论,以及其他热门游戏玩家社区',
|
||||||
item: resultItem,
|
item: resultItem,
|
||||||
|
|||||||
Reference in New Issue
Block a user