UNPKG

rsshub

Version:
39 lines (38 loc) 1.12 kB
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/hnust/chem.ts const route = { path: "/chem", categories: ["university"], example: "/hnust/chem", name: "化学化工学院通知", maintainers: ["OrbitZore"], handler }; async function handler() { const base = "https://chem.hnust.edu.cn/sytzgg/"; const link = base + "index.htm"; const response = await rofetch(link); const $ = load(response); return { title: "湖南科技大学化学化工学院通知", link, description: "湖南科技大学化学化工学院通知", image: "https://i.loli.net/2020/03/24/EAoPzbTsBxeOdjH.jpg", item: $(".subNewsList li").toArray().map((item) => { const $item = $(item); const date = $item.find("span").text(); const title = $item.find("h3").text(); return { title, description: title, pubDate: timezone(parseDate(date), 8), link: base + $item.find("a").attr("href") }; }) }; } //#endregion export { route };