rsshub
Version:
Make RSS Great Again!
58 lines (56 loc) • 1.63 kB
JavaScript
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/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 = "/finance/realtime";
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 };