UNPKG

rsshub

Version:
41 lines (40 loc) 1.37 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/ahmu/news.ts const route = { path: "/news", categories: ["university"], example: "/ahmu/news", radar: [{ source: ["yjsxy.ahmu.edu.cn/tzgg/list.htm"] }], name: "研究生学院通知公告", maintainers: ["Origami404"], handler, url: "yjsxy.ahmu.edu.cn/tzgg/list.htm" }; async function handler() { const baseUrl = "https://yjsxy.ahmu.edu.cn"; const link = `${baseUrl}/tzgg/list.htm`; const $ = load(await rofetch(link)); const list = $(".news_list li.cle").toArray().map((item) => { const $item = $(item); return { title: $item.find(".text").text().trim(), link: new URL($item.find("a").attr("href"), baseUrl).href, author: "安徽医科大学研究生学院", 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))(".wp_articlecontent").html(); return item; }))) }; } //#endregion export { route };