UNPKG

rsshub

Version:
38 lines (37 loc) 1.18 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as cache_default } from "./cache-CiDoUSLo.mjs"; import { load } from "cheerio"; //#region lib/routes/fudan/cce.ts const host = "https://www.cce.fudan.edu.cn"; const link = "https://www.cce.fudan.edu.cn/14096/list.htm"; const route = { path: "/cce", categories: ["university"], example: "/fudan/cce", name: "成人夜大通知公告", maintainers: ["mrbruce516"], features: { antiCrawler: true }, handler }; async function handler() { const $ = load(await rofetch(link)); const urlList = $(".Article_Title a").toArray().map((i) => host + $(i).attr("href")); const out = await Promise.all(urlList.map((itemUrl) => cache_default.tryGet(itemUrl, async () => { const $ = load(await rofetch(itemUrl)); const targetDate = $(".arti_update").text().match(/(\d{4}-\d{2})-\d{2}/); if (!targetDate) return ""; return { title: $(".arti_title").text(), link: itemUrl, description: $(".wp_articlecontent").html(), pubDate: targetDate[0] }; }))); return { title: "复旦大学继续教育学院 - 通知公告", link, item: out.filter((item) => item !== "") }; } //#endregion export { route };