diff --git a/docs/game.md b/docs/game.md index df52423af4..e44c3f3a82 100644 --- a/docs/game.md +++ b/docs/game.md @@ -490,12 +490,27 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 ### 最终幻想 14 国服 - + | 新闻 | 公告 | 活动 | 广告 | 所有 | | ---- | -------- | ------ | --------- | ---- | | news | announce | events | advertise | all | + + +### 最终幻想 14 国际服 (Lodestone) + + +| 北美 | 欧洲(英语) | 法国 | 德国 | 日本 | +| ---- | ------------ | ---- | ---- | ---- | +| na | eu | fr | de | jp | + +| 话题 | 公告 | 维护 | 更新 | 服务状态 | 开发者博客 | +| ------ | ------- | ----------- | ------- | -------- | ---------- | +| topics | notices | maintenance | updates | status | developers | + + + ## きららファンタジア|奇拉拉幻想曲 ### 公告 diff --git a/lib/router.js b/lib/router.js index 6297b5e2e1..7c027a90af 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1890,6 +1890,7 @@ router.get('/arknights/news', require('./routes/arknights/news')); // ff14 router.get('/ff14/ff14_zh/:type', require('./routes/ff14/ff14_zh')); +router.get('/ff14/ff14_global/:lang/:type', require('./routes/ff14/ff14_global')); // 学堂在线 router.get('/xuetangx/course/:cid/:type', require('./routes/xuetangx/course_info')); diff --git a/lib/routes/ff14/ff14_global.js b/lib/routes/ff14/ff14_global.js new file mode 100644 index 0000000000..849cf05e4e --- /dev/null +++ b/lib/routes/ff14/ff14_global.js @@ -0,0 +1,31 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const type = ctx.params.type; + const lang = ctx.params.lang; + + const response = await got({ + method: 'get', + url: `http://${lang}.lodestonenews.com/news/${type}`, + }); + + let data; + if (type === 'all') { + data = []; + Object.values(response.data).forEach((arr) => (data = data.concat(arr))); + } else { + data = response.data; + } + + ctx.state.data = { + title: `FFXIV Lodestone updates (${type})`, + link: `https://${lang}.finalfantasyxiv.com/lodestone/news/`, + item: data.map(({ id, url, title, time, description, image }) => ({ + title, + link: url, + description: `
${description}
`, + pubDate: time, + guid: id, + })), + }; +};