UNPKG

rsshub

Version:
67 lines (65 loc) 2.06 kB
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 { load } from "cheerio"; //#region lib/routes/ustb/yzxc/tzgg.ts const host = "https://yzxc.ustb.edu.cn"; const url = `${host}/tzgg/index.htm`; const route = { path: "/yzxc/tzgg", categories: ["university"], example: "/ustb/yzxc/tzgg", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["yzxc.ustb.edu.cn/"] }], name: "研究生招生信息网", maintainers: ["yanbot-team"], handler, url: "yzxc.ustb.edu.cn/" }; async function handler() { const $ = load((await got_default(url)).data); const list = $(".page_content .ul-inline .box"); return { title: "北京科技大学研究生招生信息网 - 通知公告", link: url, description: "北京科技大学研究生招生信息网 - 通知公告", item: await Promise.all(list.map((i, item) => { const $item = $(item); const time = $item.find(".time").text(); const titleDom = $item.find(".title a"); const titleText = titleDom.text(); const path = titleDom.last().attr("href"); let itemUrl = ""; if (path.startsWith("http")) itemUrl = path; else if (path.startsWith("..")) itemUrl = path.replaceAll("..", host); else itemUrl = host + path; return cache_default.tryGet(itemUrl, async () => { let description = titleText; const $$1 = load((await got_default(itemUrl)).data); if ($$1(".article") && $$1(".article").html()) description = $$1(".article").html().trim(); return { title: titleText, link: itemUrl, pubDate: parseDate(time), description }; }); })) }; } //#endregion export { route };