rsshub
Version:
Make RSS Great Again!
39 lines (38 loc) • 1.2 kB
JavaScript
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs";
import { t as parseDate } from "./parse-date-CjhZE69i.mjs";
import { t as timezone } from "./timezone-DE--ze1V.mjs";
import { load } from "cheerio";
//#region lib/routes/hnust/computer.ts
const route = {
path: "/computer",
categories: ["university"],
example: "/hnust/computer",
features: { antiCrawler: true },
name: "计算机科学与工程学院通知",
maintainers: ["Pretty9"],
handler
};
async function handler() {
const base = "https://computer.hnust.edu.cn/tzgg/";
const link = "https://computer.hnust.edu.cn/tzgg/index.htm";
const $ = load(await rofetch(link));
return {
title: "湖南科技大学计算机科学与工程学院通知",
link,
description: "湖南科技大学计算机科学与工程学院通知",
image: "https://i.loli.net/2020/03/24/EAoPzbTsBxeOdjH.jpg",
item: $(".list01 li").toArray().map((item) => {
const $item = $(item);
const date = $item.find("span").text();
const title = $item.find("a").text();
return {
title,
description: title,
pubDate: timezone(parseDate(date), 8),
link: base + $item.find("a").attr("href")
};
})
};
}
//#endregion
export { route };