rsshub
Version:
Make RSS Great Again!
67 lines (65 loc) • 2.15 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
import { t as cache_default } from "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { t as timezone } from "./timezone-D8cuwzTY.mjs";
import { load } from "cheerio";
//#region lib/routes/qdu/houqin.ts
const base = "https://houqin.qdu.edu.cn/";
const route = {
path: "/houqin",
categories: ["university"],
example: "/qdu/houqin",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["houqin.qdu.edu.cn/tzgg.htm", "houqin.qdu.edu.cn/"] }],
name: "后勤管理处通知",
maintainers: ["abc1763613206"],
handler,
url: "houqin.qdu.edu.cn/tzgg.htm"
};
async function handler() {
const $ = load((await got_default({
method: "get",
url: `${base}index/tzgg.htm`
})).data);
const list = $(".n_newslist").children();
const items = await Promise.all(list.map((i, item) => {
item = $(item);
const itemTitle = item.find("a").text();
let itemDate = timezone(parseDate(item.find("span").text()), 8);
const itemUrl = base + item.find("a").attr("href");
return cache_default.tryGet(itemUrl, async () => {
let description = "";
const $$1 = load((await got_default(itemUrl)).data);
if ($$1(".article_body").find("div > h4").text().match(/发布时间:(.*)编辑:/) !== null) itemDate = timezone(parseDate($$1(".article_body").find("div > h4").text().match(/发布时间:(.*)编辑:/)[1].trim(), "YYYY年MM月DD日 HH:mm"), 8);
description = $$1(".v_news_content").html().trim();
return {
title: itemTitle,
link: itemUrl,
pubDate: itemDate,
description
};
});
}));
return {
title: "青岛大学 - 后勤管理处通知",
link: `${base}index/tzgg.htm`,
description: "青岛大学 - 后勤管理处通知",
item: items
};
}
//#endregion
export { route };