rsshub
Version:
Make RSS Great Again!
44 lines (43 loc) • 1.39 kB
JavaScript
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/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 response = await rofetch(link);
const $ = load(response);
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 () => {
const detail = await rofetch(item.link);
item.description = load(detail)(".wp_articlecontent").html();
return item;
})));
return {
title: "浙江工商大学教务处 - 学生专区",
link,
item: items
};
}
//#endregion
export { route };