UNPKG

rsshub

Version:
42 lines (41 loc) 1.33 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/zjgsu/xszq.ts const route = { path: "/xszq", categories: ["university"], example: "/zjgsu/xszq", radar: [{ source: ["jww.zjgsu.edu.cn/1331/list.htm"] }], name: "教务处 - 学生专区", maintainers: ["nicolaszf"], handler, url: "jww.zjgsu.edu.cn/1331/list.htm" }; const host = "https://jww.zjgsu.edu.cn"; const link = `${host}/1331/list.htm`; async function handler() { const $ = load(await rofetch(link)); const list = $("li.column-news-item").toArray().map((item) => { const $item = $(item); const a = $item.find(".column-news-title a"); return { title: a.text().trim(), link: new URL(a.attr("href"), host).href, pubDate: timezone(parseDate($item.find(".column-news-date").text()), 8) }; }); const items = await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => { item.description = load(await rofetch(item.link))(".wp_articlecontent").html(); return item; }))); return { title: "浙江工商大学教务处 - 学生专区", link, item: items }; } //#endregion export { route };