feat: add 魔法纪录 (#4034)
This commit is contained in:
parent
5e1a7fae75
commit
ebc9b8372f
10
docs/game.md
10
docs/game.md
|
|
@ -394,3 +394,13 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的
|
|||
### 公告
|
||||
|
||||
<Route author="magic-akari" example="/kirara/news" path="/kirara/news"/>
|
||||
|
||||
## マギアレコード(Magia Record, 魔法纪录)
|
||||
|
||||
### 游戏公告
|
||||
|
||||
<Route author="y2361547758" example="/magireco/announcements" path="/magireco/announcements"/>
|
||||
|
||||
### 游戏横幅
|
||||
|
||||
<Route author="y2361547758" example="/magireco/event_banner" path="/magireco/event_banner"/>
|
||||
|
|
|
|||
|
|
@ -2267,6 +2267,10 @@ router.get('/kuaidi100/company', require('./routes/kuaidi100/supported_company')
|
|||
// 稻草人书屋
|
||||
router.get('/dcrsw/:name/:count?', require('./routes/novel/dcrsw'));
|
||||
|
||||
// 魔法纪录
|
||||
router.get('/magireco/announcements', require('./routes/magireco/announcements'));
|
||||
router.get('/magireco/event_banner', require('./routes/magireco/event_banner'));
|
||||
|
||||
// wolley
|
||||
router.get('/wolley', require('./routes/wolley/index'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
const got = require('@/utils/got');
|
||||
const date = require('@/utils/date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const host = `http://android.magi-reco.com`;
|
||||
const link = host + `/magica/json/announcements/announcements.json`;
|
||||
const listData = await got.get(link);
|
||||
if (!~listData.headers['content-type'].indexOf('application/json')) {
|
||||
ctx.throw(403, 'Server not allow to get announcement.');
|
||||
}
|
||||
const data = listData.data.slice(listData.data.length - 50);
|
||||
ctx.state.data = {
|
||||
title: '魔法纪录日服 - 游戏公告',
|
||||
link: link,
|
||||
description: 'Popup announcement right announcements',
|
||||
language: 'jp',
|
||||
item: data.map((item) => ({
|
||||
title: item.subject,
|
||||
categoty: [item.categoty, item.displayOs],
|
||||
description: item.text,
|
||||
pubDate: date(item.startAt, 9),
|
||||
link: 'https://jp.rika.ren/pop_up.html#id=' + item.id,
|
||||
uuid: item.id,
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
const got = require('@/utils/got');
|
||||
const date = require('@/utils/date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const host = `http://android.magi-reco.com`;
|
||||
const link = host + `/magica/json/event_banner/event_banner.json`;
|
||||
const listData = await got.get(link);
|
||||
if (!~listData.headers['content-type'].indexOf('application/json')) {
|
||||
ctx.throw(403, 'Server not allow to get announcement.');
|
||||
}
|
||||
const data = listData.data.slice(listData.data.length - 50);
|
||||
ctx.state.data = {
|
||||
title: '魔法纪录日服 - 游戏横幅',
|
||||
link: link,
|
||||
description: 'Popup announcement left event_banner',
|
||||
language: 'jp',
|
||||
item: data.map((item) => ({
|
||||
title: item.description,
|
||||
description: item.bannerText + '<br /><img src="' + host + item.imagePath + '_m.png" />',
|
||||
pubDate: date(item.startAt, 9),
|
||||
link: 'https://jp.rika.ren/pop_up.html' + (item.announcementId ? '#id=' + item.announcementId : ''),
|
||||
uuid: item.bannerId,
|
||||
media: {
|
||||
content: {
|
||||
url: host + item.imagePath + '_m.png',
|
||||
type: 'image/png',
|
||||
},
|
||||
thumbnail: {
|
||||
url: host + item.imagePath + '_a.png',
|
||||
},
|
||||
},
|
||||
})),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue