UNPKG

rsshub

Version:
55 lines (53 loc) 1.78 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 { t as cache_default } from "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { t as timezone } from "./timezone-D8cuwzTY.mjs"; import { load } from "cheerio"; //#region lib/routes/szftedu/gonggao.ts const host = "https://ylxx.szftedu.cn/xx_5828/xygg_5832/"; const route = { path: "/gonggao", categories: ["university"], example: "/szftedu/gonggao", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, name: "公告", maintainers: ["valuex"], handler, description: "" }; async function handler() { const $ = load((await got_default(host)).data); const lists = $("div.pagenews04 div ul li").toArray().map((el) => ({ title: $("a", el).text().trim(), link: $("a", el).attr("href"), pubDate: timezone(parseDate($("span[class=canedit]", el).text()), 8) })); return { title: "园岭小学公告", link: host, description: "园岭小学公告", item: await Promise.all(lists.map((item) => cache_default.tryGet(item.link, async () => { const thisUrl = item.link; const $$1 = load((await got_default(thisUrl.includes("http") ? thisUrl : host + thisUrl.slice(1))).data); item.description = thisUrl.includes("http") ? $$1("#page-content").html() : $$1("div.TRS_Editor").html(); item.pubDate = timezone(parseDate($$1(".item").first().text().replace("发布时间:", "")), 8); return item; }))) }; } //#endregion export { route };