diff --git a/docs/game.md b/docs/game.md index 2c3029b1dd..a8de4e39d7 100644 --- a/docs/game.md +++ b/docs/game.md @@ -693,7 +693,13 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` ### 新闻中心 - + + +| 全部 | 热门 | 新闻 | 公告 | 活动 | 赛事 | 优化 | +| --- | -- | -- | -- | -- | -- | -- | +| all | rm | xw | gg | hd | ss | yh | + + ## 网易大神 @@ -713,7 +719,7 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` ### 游戏折扣信息 - + | Steam | PlatStation4 | Switch | | ----- | ------------ | ------ | @@ -725,7 +731,13 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` ### 新闻中心 - + + +| 全部 | 综合 | 公告 | 赛事 | 攻略 | 社区 | +| --- | -- | -- | -- | -- | -- | +| all | zh | gg | ss | gl | sq | + + ## 游民星空 @@ -760,16 +772,18 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` ### 游戏资讯 + | Switch | PS4 | PC | Xbox | -| -------- | -------- | -------- | -------- | -| 1 | 2 | 3 | 4 | +| ------ | --- | -- | ---- | +| 1 | 2 | 3 | 4 | + ## 游戏年轮 ### 分类 - + | PC 游戏 | PS4 游戏 | Switch 游戏 | NS 其他板块 | galgame | VR 游戏 | 3DS 游戏 | psv 游戏 | xbox360 游戏 | ps3 游戏 | 其他掌机 | | ------ | ------ | --------- | ------- | ------- | ----- | ------ | ------ | ---------- | ------ | ------- | diff --git a/lib/router.js b/lib/router.js index 3da1d79a99..a115feb2b3 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1836,7 +1836,7 @@ router.get('/simonsfoundation/articles', lazyloadRouteHandler('./routes/simonsfo router.get('/simonsfoundation/recommend', lazyloadRouteHandler('./routes/simonsfoundation/recommend')); // 王者荣耀 -router.get('/tencent/pvp/newsindex/:type', lazyloadRouteHandler('./routes/tencent/pvp/newsindex')); +// router.get('/tencent/pvp/newsindex/:type', lazyloadRouteHandler('./routes/tencent/pvp/newsindex')); // 《明日方舟》游戏 (migrated to v2) // router.get('/arknights/news', lazyloadRouteHandler('./routes/arknights/news')); diff --git a/lib/v2/tencent/maintainer.js b/lib/v2/tencent/maintainer.js index c8eaa0ce0a..912c121af9 100644 --- a/lib/v2/tencent/maintainer.js +++ b/lib/v2/tencent/maintainer.js @@ -1,4 +1,5 @@ module.exports = { - '/qq/sdk/changelog/:platform': ['nuomi1'], '/cloud/column/:id?/:tag?': ['nczitzk'], + '/pvp/newsindex/:type': ['Jeason0228', 'HenryQW'], + '/qq/sdk/changelog/:platform': ['nuomi1'], }; diff --git a/lib/routes/tencent/pvp/newsindex.js b/lib/v2/tencent/pvp/newsindex.js similarity index 84% rename from lib/routes/tencent/pvp/newsindex.js rename to lib/v2/tencent/pvp/newsindex.js index 2849b976c7..58f2e64850 100644 --- a/lib/routes/tencent/pvp/newsindex.js +++ b/lib/v2/tencent/pvp/newsindex.js @@ -1,10 +1,12 @@ const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); const map = new Map([ ['rm', { name: '热门', channelid: 1760 }], ['xw', { name: '新闻', channelid: 1761 }], ['gg', { name: '公告', channelid: 1762 }], ['hd', { name: '活动', channelid: 1763 }], ['ss', { name: '赛事', channelid: 1764 }], + ['yh', { name: '优化', channelid: 1769 }], ['all', { name: '全部', channelid: 0 }], ]); const link = 'https://pvp.qq.com/web201706/newsindex.shtml'; @@ -12,7 +14,7 @@ const apiUrl = 'https://apps.game.qq.com/wmp/v3.1/?p0=18&p1=searchNewsKeywordsLi const pageUrl = `https://pvp.qq.com/web201706/newsdetail.shtml?tid=`; const getPage = async (id, typeName) => { - const response = await got.get(apiUrl + id, { + const response = await got(apiUrl + id, { headers: { Referer: link, }, @@ -20,16 +22,16 @@ const getPage = async (id, typeName) => { return Promise.all( response.data.msg.result.map(async (item) => { - let description = await got.get(`https://apps.game.qq.com/wmp/v3.1/public/searchNews.php?p0=18&source=web_pc&id=${item.iNewsId}`); + let description = await got(`https://apps.game.qq.com/wmp/v3.1/public/searchNews.php?p0=18&source=web_pc&id=${item.iNewsId}`); description = JSON.parse(description.data.match(/(?<=var searchObj=).*(? { const results = await Promise.all( Array.from(map).map(async (value) => { const res = await getPage(value[1].channelid, value[1].name); - return Promise.resolve(res); + return res; }) ); results.forEach((result) => (item = item.concat(result))); diff --git a/lib/v2/tencent/radar.js b/lib/v2/tencent/radar.js index afbe48b6a0..cb806a3286 100644 --- a/lib/v2/tencent/radar.js +++ b/lib/v2/tencent/radar.js @@ -1,6 +1,18 @@ module.exports = { 'qq.com': { _name: '腾讯', + egame: [ + { + title: '企鹅电竞直播间', + docs: 'https://docs.rsshub.app/live.html#qi-e-dian-jing-zhi-bo-jian-kai-bo', + source: '/:id', + target: (params) => { + if (params.id.match(/^\d+$/)) { + return '/egameqq/room/:id'; + } + }, + }, + ], 'mp.weixin': [ { title: '微信公众号栏目', @@ -15,16 +27,12 @@ module.exports = { target: (params, url) => `/wechat/mp/msgalbum/${new URL(url).searchParams.get('__biz')}/${new URL(url).searchParams.get('album_id')}`, }, ], - egame: [ + pvp: [ { - title: '企鹅电竞直播间', - docs: 'https://docs.rsshub.app/live.html#qi-e-dian-jing-zhi-bo-jian-kai-bo', - source: '/:id', - target: (params) => { - if (params.id.match(/^\d+$/)) { - return '/egameqq/room/:id'; - } - }, + title: '王者荣耀 - 新闻中心', + docs: 'https://docs.rsshub.app/game.html#wang-zhe-rong-yao', + source: ['/web201706/*', '/'], + target: '/tencent/pvp/newsindex/all', }, ], v: [ diff --git a/lib/v2/tencent/router.js b/lib/v2/tencent/router.js index 46f91af6fa..fc686be3eb 100644 --- a/lib/v2/tencent/router.js +++ b/lib/v2/tencent/router.js @@ -1,4 +1,5 @@ module.exports = (router) => { - router.get('/qq/sdk/changelog/:platform', require('./qq/sdk/changelog')); router.get('/cloud/column/:id?/:tag?', require('./cloud/column')); + router.get('/pvp/newsindex/:type', require('./pvp/newsindex')); + router.get('/qq/sdk/changelog/:platform', require('./qq/sdk/changelog')); };