UNPKG

rsshub

Version:
49 lines (48 loc) 1.37 kB
import { n as parseList, t as logo } from "./util-knb0Qkbt.mjs"; //#region lib/routes/zaobao/realtime.ts const baseUrl = "https://www.zaobao.com"; const route = { path: "/realtime/:section?", categories: ["traditional-media"], example: "/zaobao/realtime/china", parameters: { section: "分类,缺省为 china" }, name: "即时新闻", maintainers: ["shunf4"], handler, description: `| 中国 | 新加坡 | 国际 | 财经 | | ----- | --------- | ----- | -------- | | china | singapore | world | zfinance |` }; async function handler(ctx) { const section = ctx.req.param("section") ?? "china"; let name; let sectionLink; switch (section) { case "singapore": name = "新加坡"; sectionLink = "/realtime/singapore"; break; case "world": name = "国际"; sectionLink = "/realtime/world"; break; case "zfinance": name = "财经"; sectionLink = "/realtime/finance"; break; default: name = "中港台"; sectionLink = "/realtime/china"; break; } const { resultList } = await parseList(sectionLink); return { title: `《联合早报》-${name}-即时`, link: baseUrl + sectionLink, description: "新加坡、中国、亚洲和国际的即时、评论、商业、体育、生活、科技与多媒体新闻,尽在联合早报。", image: logo, item: resultList }; } //#endregion export { route };