UNPKG

rsshub

Version:
69 lines (67 loc) 1.83 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import "./parse-date-r5WDWHno.mjs"; import "./is-worker-DESPicPc.mjs"; import "./cache-SV6W5EPy.mjs"; import "./timezone-CA9Huotp.mjs"; import { n as parseList, t as logo } from "./util-yyjCgkti.mjs"; //#region lib/routes/zaobao/znews.ts const baseUrl = "https://www.zaobao.com"; const route = { path: "/znews/:section?", categories: ["traditional-media"], example: "/zaobao/znews/china", parameters: { section: "分类,缺省为 china" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, name: "新闻", maintainers: ["shunf4"], handler, description: `| 中国 | 新加坡 | 东南亚 | 国际 | 体育 | | ----- | --------- | ------ | ----- | ------ | | china | singapore | sea | world | sports |` }; async function handler(ctx) { const section = ctx.req.param("section"); let info; let sectionLink; switch (section) { case "singapore": info = "新加坡"; sectionLink = "/news/singapore"; break; case "world": info = "国际"; sectionLink = "/news/world"; break; case "sea": info = "东南亚"; sectionLink = "/news/sea"; break; case "sports": info = "体育"; sectionLink = "/news/sports"; break; default: info = "中国"; sectionLink = "/news/china"; } const { resultList } = await parseList(sectionLink); return { title: `《联合早报》-${info}-新闻`, link: baseUrl + sectionLink, description: "新加坡、中国、亚洲和国际的即时、评论、商业、体育、生活、科技与多媒体新闻,尽在联合早报。", image: logo, item: resultList }; } //#endregion export { route };