UNPKG

rsshub

Version:
41 lines (40 loc) 1.32 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as parseDate } from "./parse-date-CjhZE69i.mjs"; import { t as cache_default } from "./cache-CiDoUSLo.mjs"; import { t as timezone } from "./timezone-DE--ze1V.mjs"; import { load } from "cheerio"; //#region lib/routes/cug/graduate.ts const route = { path: "/graduate", categories: ["university"], example: "/cug/graduate", radar: [{ source: ["graduate.cug.edu.cn/tzgg.htm"] }], name: "研究生院通知公告", maintainers: ["sanmmm"], handler, url: "graduate.cug.edu.cn/tzgg.htm" }; async function handler() { const baseUrl = "https://graduate.cug.edu.cn"; const link = `${baseUrl}/tzgg.htm`; const $ = load(await rofetch(link)); const list = $(".btlist ul li").toArray().map((item) => { const $item = $(item); const a = $item.find("a"); return { title: a.attr("title") || a.text(), link: new URL(a.attr("href"), baseUrl).href, pubDate: timezone(parseDate($item.find(".time").text(), "YYYY-MM-DD"), 8) }; }); return { title: "中国地质大学(武汉)研究生院 - 通知公告", link, item: await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => { item.description = load(await rofetch(item.link))(".v_news_content").html(); return item; }))) }; } //#endregion export { route };