rsshub
Version:
Make RSS Great Again!
40 lines (39 loc) • 1.34 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/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 response = await rofetch(link);
const $ = load(response);
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 () => {
const detailResponse = await rofetch(item.link);
item.description = load(detailResponse)(".article-content").html() ?? void 0;
return item;
})))
};
}
//#endregion
export { route };