Files
RSSHub/lib/v2/mihoyo/radar.js
T
Raven-tu 6fe52ef253 fix(route): yuanshen news error (#11115)
* fix: yuanshen new route

* refactor: migrate to v2

* fix: full article feed
2022-10-28 04:25:34 +08:00

51 lines
1.8 KiB
JavaScript

module.exports = {
'hoyoverse.com': {
_name: '米哈游',
genshin: [
{
title: '原神 - 新闻',
docs: 'https://docs.rsshub.app/game.html##mi-ha-you',
source: '/:location/news',
target: '/mihoyo/ys/:location',
},
],
},
'mihoyo.com': {
_name: '米哈游',
bbs: [
{
title: '米游社 - 官方公告',
docs: 'https://docs.rsshub.app/game.html#mi-ha-you-mi-you-she-guan-fang-gong-gao',
source: ['/:game/home/28', '/:game/home/6', '/:game/home/31', '/:game/home/33', '/:game/home/53', '/:game/home/58'],
target: (params, url) => {
const GITS_MAP = {
bh3: 1, // '崩坏三',
ys: 2, // '原神',
bh2: 3, // '崩坏二',
wd: 4, // '未定事件簿',
sr: 6, // '崩坏:星穹铁道',
zzz: 8, // '绝区零'
};
const { game } = params;
const gids = GITS_MAP[game];
if (!gids) {
return '';
}
const { type = '2' } = new URL(url).searchParams;
const page_size = '20';
const last_id = '';
return `/mihoyo/bbs/official/${gids}/${type}/${page_size}/${last_id}`;
},
},
],
ys: [
{
title: '原神 - 新闻',
docs: 'https://docs.rsshub.app/game.html##mi-ha-you',
source: '/:location/news/:category',
target: '/mihoyo/ys/:location/:category',
},
],
},
};