UNPKG

rsshub

Version:
33 lines (32 loc) 848 B
import { t as got_default } from "./got-BTowW50G.mjs"; import { n as apiRootUrl, r as rootUrl, t as ProcessItems } from "./utils-BVUToEbk.mjs"; //#region lib/routes/hk01/tag.ts const route = { path: "/tag/:id?", categories: ["new-media"], example: "/hk01/tag/2787", parameters: { id: "标签 id, 可在 URL 中找到" }, radar: [{ source: ["hk01.com/tag/:id", "hk01.com/"] }], name: "标签", maintainers: [ "hoilc", "Fatpandac", "nczitzk" ], handler }; async function handler(ctx) { const id = ctx.req.param("id") ?? "1"; const currentUrl = `${rootUrl}/tag/${id}`; const items = await ProcessItems((await got_default({ method: "get", url: `${apiRootUrl}/v2/feed/tag/${id}` })).data.items, ctx.req.query("limit")); return { title: `${id} | 香港01`, link: currentUrl, item: items }; } //#endregion export { route };