mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: add Konami PES mobile (#6160)
This commit is contained in:
@@ -16,6 +16,12 @@ pageClass: routes
|
||||
|
||||
<RouteEn author="Zyx-A" example="/epicgames/freegames" path="/epicgames/freegames"/>
|
||||
|
||||
## Konami
|
||||
|
||||
### PES Mobile Announcement
|
||||
|
||||
<RouteEn author="HenryQW" example="/konami/pesmobile/en/ios" path="/konami/pesmobile/:lang?/:os?" :paramsDesc="['language, obtained from the URL, eg. zh-cn, zh-tw, en', 'operating system,iOS or Android']"/>
|
||||
|
||||
## Metacritic
|
||||
|
||||
### Game Releases
|
||||
|
||||
@@ -112,6 +112,12 @@ pageClass: routes
|
||||
|
||||
<Route author="GensouSakuya kt286" example="/indienova/article" path="indienova/:type" :paramsDesc="['类型: `article` 文章,`development` 开发']"/>
|
||||
|
||||
## Konami
|
||||
|
||||
### PES Mobile 公告
|
||||
|
||||
<Route author="HenryQW" example="/konami/pesmobile/zh-cn/ios" path="/konami/pesmobile/:lang?/:os?" :paramsDesc="['语言,在URL中获得,如zh-cn, zh-tw, en', '操作系统,iOS 或 Android']"/>
|
||||
|
||||
## Liquipedia
|
||||
|
||||
### Dota2 战队最近比赛结果
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user