rsshub
Version:
Make RSS Great Again!
38 lines (37 loc) • 1.27 kB
JavaScript
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/sctu/it/index.ts
const route = {
path: "/it",
categories: ["university"],
example: "/sctu/it",
radar: [{ source: ["www.sctu.edu.cn/it/zxdt/tzgg.htm"] }],
name: "人工智能学院通知公告",
maintainers: ["talenHuang"],
handler
};
async function handler() {
const link = "http://www.sctu.edu.cn/it/zxdt/tzgg.htm";
const $ = load(await rofetch(link));
const list = $(".right-list-item a").toArray().map((item) => {
const $item = $(item);
return {
title: $item.find(".list-item-title").text(),
link: new URL($item.attr("href"), link).href,
pubDate: timezone(parseDate($item.find(".m-item-date").text(), "YYYY年MM月DD日"), 8)
};
});
return {
title: "通知公告 - 四川旅游学院人工智能学院",
link,
item: await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => {
item.description = load(await rofetch(item.link))(".article-content").html() ?? void 0;
return item;
})))
};
}
//#endregion
export { route };