UNPKG

rsshub

Version:
30 lines (29 loc) 889 B
import { t as rofetch } from "./ofetch-U0CdpE2g.mjs"; import { t as parseDate } from "./parse-date-3kcy2Eau.mjs"; import { t as timezone } from "./timezone-UiMFOuvL.mjs"; import { load } from "cheerio"; //#region lib/routes/hfut/tzgg.ts const route = { path: "/tzgg", categories: ["university"], example: "/hfut/tzgg", name: "通知公告", maintainers: ["logerrors"], handler }; async function handler() { const baseUrl = "https://news.hfut.edu.cn/tzgg2.htm"; const response = await rofetch(baseUrl); const $ = load(response); return { link: baseUrl, title: $("title").text(), item: $("#tzz li").slice(0, 10).toArray().map((elem) => ({ title: $("a", elem).attr("title"), link: $("a", elem).attr("href"), pubDate: timezone(parseDate($("a > i", elem).text().replace("年", "-").replace("月", "-").replace("日", "")), 8) })) }; } //#endregion export { route };