rsshub
Version:
Make RSS Great Again!
56 lines (54 loc) • 1.99 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import { t as ViewType } from "./types-D84BRIt4.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./parse-date-BrP7mxXf.mjs";
import "./render-BQo6B4tL.mjs";
import { n as processItems, t as baseUrl } from "./util-iMYxOXyN.mjs";
//#region lib/routes/gcores/topics.ts
const handler = async (ctx) => {
const { id } = ctx.req.param();
const limit = Number.parseInt(ctx.req.query("limit") ?? "30", 10);
const targetUrl = new URL(`topics/${id ?? "home"}`, baseUrl).href;
const apiUrl = new URL(`gapi/v1/${id ? `topics/${id}/recommend` : "talk-original-recommendations"}`, baseUrl).href;
return await processItems(limit, {
"page[limit]": limit,
include: "talk,talk.topic,talk.user",
"talk-include": "topic,user"
}, apiUrl, targetUrl);
};
const route = {
path: ["/topics/:id/recommend", "/topics/recommend"],
name: "机组推荐",
url: "www.gcores.com",
maintainers: ["nczitzk"],
handler,
example: "/gcores/topics/recommend",
parameters: { id: { description: "小组 ID,默认为空,即全部,可在对应小组页 URL 中找到" } },
description: `::: tip
若订阅 [我的年度总结](https://www.gcores.com/topics/581),网址为 \`https://www.gcores.com/topics/581\`,请截取 \`https://www.gcores.com/topics/\` 到末尾的部分 \`581\` 作为 \`id\` 参数填入,此时目标路由为 [\`/gcores/topics/581/recommend\`](https://rsshub.app/gcores/topics/581/recommend)。
:::
`,
categories: ["game"],
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportRadar: true,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{
source: ["www.gcores.com/topics/home"],
target: "/gcores/topics/recommend"
}, {
source: ["www.gcores.com/topics/:id"],
target: "/gcores/topics/:id/recommend"
}],
view: ViewType.SocialMedia
};
//#endregion
export { handler, route };