rsshub
Version:
Make RSS Great Again!
67 lines (65 loc) • 2.14 kB
JavaScript
import "./dist-Bog6z_OM.mjs";
import "./config-MQ-7ebJ_.mjs";
import "./logger-C4avouvV.mjs";
import "./ofetch-DKl_Ma9g.mjs";
import { t as parseDate } from "./parse-date-r5WDWHno.mjs";
import "./is-worker-DESPicPc.mjs";
import { t as cache_default } from "./cache-SV6W5EPy.mjs";
import "./helpers-Bo4JQYdN.mjs";
import { t as got_default } from "./got-CO-ndVl2.mjs";
import { t as timezone } from "./timezone-CA9Huotp.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 $ = load((await got_default(itemUrl)).data);
if ($(".article_body").find("div > h4").text().match(/发布时间:(.*)编辑:/) !== null) itemDate = timezone(parseDate($(".article_body").find("div > h4").text().match(/发布时间:(.*)编辑:/)[1].trim(), "YYYY年MM月DD日 HH:mm"), 8);
description = $(".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 };