UNPKG

rsshub

Version:
52 lines (50 loc) 1.41 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 "./helpers-DxBp0Pty.mjs"; import "./render-BQo6B4tL.mjs"; import "./got-KxxWdaxq.mjs"; import { a as rootUrl, i as processItems, n as icon, r as image, t as apiRootUrl } from "./util-DP6JTAR5.mjs"; //#region lib/routes/foresightnews/news.ts const route = { path: "/news", categories: ["new-media"], example: "/foresightnews/news", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["foresightnews.pro/news", "foresightnews.pro/"] }], name: "快讯", maintainers: ["nczitzk"], handler, url: "foresightnews.pro/news" }; async function handler(ctx) { const limit = ctx.req.query("limit") ? Number.parseInt(ctx.req.query("limit"), 10) : 50; const apiUrl = new URL("v1/news", apiRootUrl).href; const currentUrl = new URL("news", rootUrl).href; const { items } = await processItems(apiUrl, limit); return { item: items, title: "Foresight News - 快讯", link: currentUrl, description: "快讯 - Foresight News", language: "zh-cn", image, icon, logo: icon, subtitle: "快讯", author: "Foresight News" }; } //#endregion export { route };