UNPKG

rsshub

Version:
42 lines (41 loc) 1.44 kB
import { t as rofetch } from "./ofetch-U0CdpE2g.mjs"; import { t as parseDate } from "./parse-date-3kcy2Eau.mjs"; import { t as cache_default } from "./cache-C1Y-9qDV.mjs"; import { t as timezone } from "./timezone-UiMFOuvL.mjs"; import { load } from "cheerio"; //#region lib/routes/gzmtu/jwc.ts const route = { path: "/jwc", categories: ["university"], example: "/gzmtu/jwc", name: "教务处通知公告", maintainers: ["skyedai910"], handler }; async function handler() { const link = "https://jwc.gzmtu.edu.cn/"; const response = await rofetch(link); const $ = load(response); return { title: "广州航海学院教务处通知公告", description: "广州航海学院教务处教务通知、教务动态、教务简报 RSS by SkYe231", link, item: await Promise.all($("div .center_article_list").find("td a").toArray().map((item) => new URL($(item).attr("href"), link).href).map((itemUrl) => cache_default.tryGet(itemUrl, async () => { const response = await rofetch(itemUrl); const $ = load(response); $("img, div, span, p, table, td, tr").removeAttr("style"); $("style, script").remove(); return { title: $("h2").text(), author: "广州航海学院教务处", link: itemUrl, pubDate: timezone(parseDate($("div[id=articleInfo]").text().slice(5, 15)), 8), description: $("div .body").html(), guid: itemUrl }; }))), language: "zh-CN" }; } //#endregion export { route };