diff --git a/docs/en/game.md b/docs/en/game.md index 9600be3024..221bcf00e5 100755 --- a/docs/en/game.md +++ b/docs/en/game.md @@ -16,6 +16,12 @@ pageClass: routes +## Konami + +### PES Mobile Announcement + + + ## Metacritic ### Game Releases diff --git a/docs/game.md b/docs/game.md index c08459f7c5..a5e9ab5e73 100644 --- a/docs/game.md +++ b/docs/game.md @@ -112,6 +112,12 @@ pageClass: routes +## Konami + +### PES Mobile 公告 + + + ## Liquipedia ### Dota2 战队最近比赛结果 diff --git a/lib/router.js b/lib/router.js index b6fead7b43..9729b14f96 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1533,6 +1533,9 @@ router.get('/gamersky/ent/:category', require('./routes/gamersky/ent')); // 游研社 router.get('/yystv/category/:category', require('./routes/yystv/category')); +// konami +router.get('/konami/pesmobile/:lang?/:os?', require('./routes/konami/pesmobile')); + // psnine router.get('/psnine/index', require('./routes/psnine/index')); router.get('/psnine/shuzhe', require('./routes/psnine/shuzhe')); diff --git a/lib/routes/konami/pesmobile.js b/lib/routes/konami/pesmobile.js new file mode 100644 index 0000000000..7b11c8eeb6 --- /dev/null +++ b/lib/routes/konami/pesmobile.js @@ -0,0 +1,31 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const os = ctx.params.os || 'ios'; + const lang = ctx.params.lang || 'zh-cn'; + + const link = `https://www.konami.com/wepes/mobile/${lang}/information?os=${os}&page=1&num=20`; + const response = await got.get(link); + const $ = cheerio.load(response.data); + + const items = $('ul.topics_list li') + .get() + .slice(1, 11) + .map((m) => { + const title = `[${$(m).find('span.category-information').text()}] ${$(m).find('span.topics_title').text()}`; + return { + title, + link, + description: $(m).find('div.topics_text').html(), + pubDate: new Date($(m).find('span.topics_date').text()), + guid: `PES Mobile ${title} ${$(m).find('span.topics_date').text()}`, + }; + }); + + ctx.state.data = { + title: `PES Mobile ${$('h1').text()}`, + link, + item: items, + }; +};