UNPKG

rsshub

Version:
42 lines (41 loc) 1.32 kB
import { t as parseDate } from "./parse-date-Cr0wQjV_.mjs"; import { t as cache_default } from "./cache-BkqOokyU.mjs"; import { t as got_default } from "./got-BTowW50G.mjs"; import { t as timezone } from "./timezone-BBvDwS_3.mjs"; import { load } from "cheerio"; //#region lib/routes/ecnu/history.ts const route = { path: "/history", categories: ["university"], example: "/ecnu/history", radar: [{ source: ["history.ecnu.edu.cn"], target: "/history" }], name: "历史学系通知公告", maintainers: [ "FrozenStarrrr", "ChiyoYuki", "ECNU-minus" ], handler: async () => { const baseUrl = "https://history.ecnu.edu.cn/"; const $ = load((await got_default(`${baseUrl}33433/list.htm`)).data); const links = $("ul.data-list2 > li").toArray().map((el) => ({ pubDate: timezone(parseDate($(el).find("span").text()), 8), link: new URL($(el).find("a").attr("href"), baseUrl).href, title: $(el).find("a").text() })); return { title: "历史学系通知公告", link: "https://history.ecnu.edu.cn/33433/list.htm", item: await Promise.all(links.map((item) => cache_default.tryGet(item.link, async () => { const { data } = await got_default(item.link); item.description = load(data)("div.wp_articlecontent").html(); return item; }))) }; } }; //#endregion export { route };