mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-08-29 01:53:47 +08:00
fix(route): migrate pjsk (#14673)
* fix(route): migrate pjsk * fix(routes): Use esm export Co-authored-by: Tony <TonyRL@users.noreply.github.com> * feat(route): add radar.ts for pjsk * refactor: move to proper namespace ---------
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
// eslint-disable-next-line n/no-extraneous-require
|
||||
const Router = require('@koa/router');
|
||||
const router = new Router();
|
||||
|
||||
@@ -1753,7 +1754,7 @@ router.get('/potplayer/update/:language?', lazyloadRouteHandler('./routes/potpla
|
||||
router.get('/modian/zhongchou/:category?/:sort?/:status?', lazyloadRouteHandler('./routes/modian/zhongchou'));
|
||||
|
||||
// 世界计划 多彩舞台 feat.初音未来 (ProjectSekai)
|
||||
router.get('/pjsk/news', lazyloadRouteHandler('./routes/pjsk/news'));
|
||||
// router.get('/pjsk/news', lazyloadRouteHandler('./routes/pjsk/news'));
|
||||
|
||||
// 人民论坛网
|
||||
router.get('/rmlt/idea/:category?', lazyloadRouteHandler('./routes/rmlt/idea'));
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
'/pjsekai/news': ['15x15G'],
|
||||
};
|
||||
@@ -1,7 +1,8 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const timezone = require('@/utils/timezone');
|
||||
module.exports = async (ctx) => {
|
||||
import got from '@/utils/got';
|
||||
import * as cheerio from 'cheerio';
|
||||
import timezone from '@/utils/timezone';
|
||||
import cache from '@/utils/cache';
|
||||
export default async (ctx) => {
|
||||
// 从仓库 Sekai-World/sekai-master-db-diff 获取最新公告
|
||||
const response = await got.get(`https://cdn.jsdelivr.net/gh/Sekai-World/sekai-master-db-diff@master/userInformations.json`);
|
||||
const posts = response.data || [];
|
||||
@@ -15,10 +16,10 @@ module.exports = async (ctx) => {
|
||||
const path = post.path.replace(/information\/index.html\?id=/, '');
|
||||
link = `https://production-web.sekai.colorfulpalette.org/${post.path}`;
|
||||
try {
|
||||
description = await ctx.cache.tryGet(guid, async () => {
|
||||
description = await cache.tryGet(guid, async () => {
|
||||
const result = await got.get(`https://production-web.sekai.colorfulpalette.org/html/${path}.html`);
|
||||
const $ = cheerio.load(result.data);
|
||||
return $('body').html();
|
||||
return $.html();
|
||||
});
|
||||
} catch {
|
||||
description = link;
|
||||
@@ -40,10 +41,10 @@ module.exports = async (ctx) => {
|
||||
return item;
|
||||
})
|
||||
);
|
||||
ctx.state.data = {
|
||||
ctx.set('data', {
|
||||
title: 'Project Sekai - News',
|
||||
link: 'https://pjsekai.sega.jp/',
|
||||
description: 'プロジェクトセカイ カラフルステージ! feat.初音ミク',
|
||||
item: list,
|
||||
};
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'sega.jp': {
|
||||
_name: 'SEGA',
|
||||
pjsekai: [
|
||||
{
|
||||
title: 'Project Sekai / プロセカ Game News',
|
||||
docs: 'https://docs.rsshub.app/routes/game#sega',
|
||||
source: ['/news/index.html'],
|
||||
target: '/sega/pjsekai/news',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export default (router) => {
|
||||
router.get('/pjsekai/news', './pjsekai.ts');
|
||||
};
|
||||
@@ -510,6 +510,12 @@
|
||||
| RDR2 | 荒野大镖客 2 |
|
||||
</Route>
|
||||
|
||||
## SEGA {#sega}
|
||||
|
||||
### 世界计划 多彩舞台 | ProjectSekai | プロセカ {#sega-shi-jie-ji-hua-duo-cai-wu-tai-projectsekai-%E3%83%97%E3%83%AD%E3%82%BB%E3%82%AB}
|
||||
|
||||
<Route author="15x15G" example="/sega/pjsekai/news" path="/sega/pjsekai/news" />
|
||||
|
||||
## Steam {#steam}
|
||||
|
||||
### Steam search {#steam-steam-search}
|
||||
@@ -867,12 +873,6 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547`
|
||||
| 1 | 3 |
|
||||
</Route>
|
||||
|
||||
## 世界计划 多彩舞台 | ProjectSekai | プロセカ {#shi-jie-ji-hua-duo-cai-wu-tai-projectsekai-%E3%83%97%E3%83%AD%E3%82%BB%E3%82%AB}
|
||||
|
||||
### News {#shi-jie-ji-hua-duo-cai-wu-tai-projectsekai-%E3%83%97%E3%83%AD%E3%82%BB%E3%82%AB-news}
|
||||
|
||||
<Route author="15x15G" example="/pjsk/news" path="/pjsk/news" />
|
||||
|
||||
## 完美世界电竞 {#wan-mei-shi-jie-dian-jing}
|
||||
|
||||
### 资讯列表 {#wan-mei-shi-jie-dian-jing-zi-xun-lie-biao}
|
||||
|
||||
Reference in New Issue
Block a user