UNPKG

rsshub

Version:
55 lines (53 loc) 1.68 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import { t as timezone } from "./timezone-D8cuwzTY.mjs"; import { load } from "cheerio"; //#region lib/routes/chnmuseum/xingnew.ts const route = { path: "/zx/xingnew", categories: ["travel"], example: "/zx/xingnew", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["chnmuseum.cn/zx/xingnew"], target: "/zx/xingnew" }], name: "资讯要闻", maintainers: ["ShabbyWhineYear"], handler: async () => { const $ = load(await ofetch_default("https://www.chnmuseum.cn/zx/xingnew/")); const list = $("ul.cj_xushuliebao_list li").toArray().map((item) => { item = $(item); const a = item.find("a"); const dateText = item.find("span.date").text(); return { title: a.attr("title") || a.text(), link: new URL(a.attr("href"), "https://www.chnmuseum.cn/zx/xingnew/").href, pubDate: timezone(parseDate(dateText, "YYYY/MM/DD"), 8) }; }); return { title: "中国国家博物馆资讯要闻", link: "https://www.chnmuseum.cn/zx/xingnew/", item: await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => { item.description = load(await ofetch_default(item.link))(".cj_xw_cong").first().html(); return item; }))) }; } }; //#endregion export { route };