UNPKG

rsshub

Version:
47 lines (46 loc) 1.51 kB
import { t as parseDate } from "./parse-date-Cr0wQjV_.mjs"; import { t as cache_default } from "./cache-BkqOokyU.mjs"; import { t as got_default } from "./got-BTowW50G.mjs"; import { t as timezone } from "./timezone-BBvDwS_3.mjs"; import { load } from "cheerio"; //#region lib/routes/ecnu/geoai.ts const type = (filename) => filename.split(".").pop(); const route = { path: "/geoai", categories: ["university"], example: "/ecnu/geoai", radar: [{ source: ["geoai.ecnu.edu.cn"], target: "/geoai" }], name: "空间人工智能学院通知公告", maintainers: [ "FrozenStarrrr", "ChiyoYuki", "ECNU-minus" ], handler: async () => { const baseUrl = "https://geoai.ecnu.edu.cn/"; const $ = load((await got_default(`${baseUrl}tzgg/list.htm`)).data); const links = $("ul.news_list > li").toArray().map((el) => ({ pubDate: timezone(parseDate($(el).find(".news_meta").text()), 8), link: new URL($(el).find("a").attr("href"), baseUrl).href, title: $(el).find("a").text() })); return { title: "空间人工智能学院通知公告", link: "https://geoai.ecnu.edu.cn/tzgg/list.htm", item: await Promise.all(links.map((item) => cache_default.tryGet(item.link, async () => { if (type(item.link) === "htm") { const { data } = await got_default(item.link); item.description = load(data)("div.wp_articlecontent").html(); return item; } item.description = "点击认证后访问内容"; return item; }))) }; } }; //#endregion export { route };