UNPKG

rsshub

Version:
45 lines (43 loc) 1.43 kB
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 { t as cache_default } from "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import "./render-BQo6B4tL.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { c as fetchData, d as rootUrl, i as apiMomentRootUrl, u as processItems } from "./util-DaV7o5tf.mjs"; //#region lib/routes/huxiu/moment.ts const route = { path: "/moment", categories: ["new-media"], example: "/huxiu/moment", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: true, supportPodcast: true, supportScihub: false }, radar: [{ source: ["huxiu.com/moment"] }], name: "24 小时", maintainers: ["nczitzk"], handler, url: "huxiu.com/moment" }; async function handler(ctx) { const limit = ctx.req.query("limit") ? Number.parseInt(ctx.req.query("limit"), 10) : 20; const apiUrl = new URL("web-v2/moment/feed", apiMomentRootUrl).href; const currentUrl = new URL("moment", rootUrl).href; const { data: response } = await got_default.post(apiUrl, { form: { platform: "www" } }); return { item: await processItems(response.data.moment_list.datalist[0].datalist, limit, cache_default.tryGet), ...await fetchData(currentUrl) }; } //#endregion export { route };