UNPKG

rsshub

Version:
54 lines (52 loc) 1.47 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import "./helpers-DxBp0Pty.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { load } from "cheerio"; //#region lib/routes/gov/sh/wsjkw/yqtb/index.ts const route = { path: ["/sh/wsjkw/yqtb", "/shanghai/wsjkw/yqtb"], categories: ["government"], example: "/gov/sh/wsjkw/yqtb", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["wsjkw.sh.gov.cn/"] }], name: "上海卫健委 疫情通报", maintainers: ["zcf0508"], handler, url: "wsjkw.sh.gov.cn/" }; async function handler() { const url = `https://wsjkw.sh.gov.cn/yqtb/index.html`; const $ = load((await got_default.get(url)).data); return { title: "疫情通报-上海卫健委", link: url, item: $(".uli16.nowrapli.list-date li").toArray().map((item) => { item = $(item); const title = item.find("a").text(); const address = item.find("a").attr("href"); const host = `https://wsjkw.sh.gov.cn`; return { title, description: title, pubDate: parseDate(item.find("span").text(), "YYYY-MM-DD"), link: host + address, guid: host + address }; }) }; } //#endregion export { route };