rsshub
Version:
Make RSS Great Again!
66 lines (64 loc) • 1.87 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/ahjzu/news.ts
const route = {
path: "/news",
categories: ["university"],
example: "/ahjzu/news",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["news.ahjzu.edu.cn/20/list.htm"] }],
name: "通知公告",
maintainers: ["Yuk-0v0"],
handler,
url: "news.ahjzu.edu.cn/20/list.htm"
};
async function handler() {
const rootUrl = "https://www.ahjzu.edu.cn";
const currentUrl = "https://www.ahjzu.edu.cn/20/list.htm";
const $ = load((await got_default({
method: "get",
url: currentUrl
})).data);
const list = $("#wp_news_w9").find("li").toArray().map((item) => {
item = $(item);
const date = item.find(".column-news-date").text();
const a = item.find("a").attr("href");
const link = a.slice(0, 4) === "http" ? a : rootUrl + a;
return {
title: item.find("a").attr("title"),
link,
pubDate: timezone(parseDate(date), 8)
};
});
return {
title: "安建大-通知公告",
description: "安徽建筑大学-通知公告",
link: currentUrl,
item: await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => {
item.description = load((await got_default({
method: "get",
url: item.link
})).data)(".wp_articlecontent").html();
return item;
})))
};
}
//#endregion
export { route };