rsshub
Version:
Make RSS Great Again!
80 lines (78 loc) • 1.85 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./parse-date-BrP7mxXf.mjs";
import "./cache-Bo__VnGm.mjs";
import "./timezone-D8cuwzTY.mjs";
import { i as parseArticleList, n as getArticleList, r as mdTableBuilder, t as getArticle } from "./utils-B_j8FHmv.mjs";
//#region lib/routes/gamersky/review.ts
const idNameMap = [
{
type: "pc",
name: "单机",
nodeId: "20465"
},
{
type: "tv",
name: "电视",
nodeId: "20466"
},
{
type: "indie",
name: "独立游戏",
nodeId: "20922"
},
{
type: "web",
name: "网游",
nodeId: "20916"
},
{
type: "mobile",
name: "手游",
nodeId: "20917"
},
{
type: "all",
name: "全部评测",
nodeId: "20915"
}
];
const route = {
path: "/review/:type?",
categories: ["game"],
example: "/gamersky/review/pc",
parameters: { type: "评测类型,可选值为 `pc`、`tv`、`indie`、`web`、`mobile`、`all`,默认为 `pc`" },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{
source: ["www.gamersky.com/review"],
target: "/review"
}],
name: "评测",
maintainers: ["yy4382"],
description: mdTableBuilder(idNameMap),
handler
};
async function handler(ctx) {
const type = ctx.req.param("type") ?? "pc";
const idName = idNameMap.find((item) => item.type === type);
if (!idName) throw new Error(`Invalid type: ${type}`);
const list = parseArticleList(await getArticleList(idName.nodeId));
const fullTextList = await Promise.all(list.map((item) => getArticle(item)));
return {
title: `${idName.name} - 游民星空评测`,
link: "https://www.gamersky.com/review",
item: fullTextList
};
}
//#endregion
export { route };