UNPKG

rsshub

Version:
35 lines (34 loc) 948 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/zone.ts const route = { path: "/zone/:id?", categories: ["new-media"], example: "/hk01/zone/11", parameters: { id: "栏目 id, 可在 URL 中找到" }, radar: [{ source: ["hk01.com/zone/:id", "hk01.com/"] }], name: "栏目", maintainers: [ "hoilc", "Fatpandac", "nczitzk" ], handler }; async function handler(ctx) { const id = ctx.req.param("id") ?? "1"; const currentUrl = `${rootUrl}/zone/${id}`; const response = await got_default({ method: "get", url: `${apiRootUrl}/v2/feed/zone/${id}` }); const items = await ProcessItems(response.data.items, ctx.req.query("limit")); return { title: `${response.data.category.publishName} | 香港01`, link: currentUrl, item: items, image: response.data.category.icon }; } //#endregion export { route };