UNPKG

rsshub

Version:
61 lines (56 loc) 2.05 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { load } from "cheerio"; //#region lib/routes/hrbeu/job/calendar.ts const rootUrl = "http://job.hrbeu.edu.cn"; const route = { path: "/job/calendar", categories: ["university"], example: "/hrbeu/job/calendar", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["job.hrbeu.edu.cn/*"] }], name: "就业服务平台", maintainers: ["Derekmini"], handler, url: "job.hrbeu.edu.cn/*", description: `| 通知公告 | 热点新闻 | | :------: | :------: | | tzgg | rdxw | #### 大型招聘会 {#ha-er-bin-gong-cheng-da-xue-jiu-ye-fu-wu-ping-tai-da-xing-zhao-pin-hui} #### 今日招聘会 {#ha-er-bin-gong-cheng-da-xue-jiu-ye-fu-wu-ping-tai-jin-ri-zhao-pin-hui}` }; async function handler() { const date = /* @__PURE__ */ new Date(); const year = date.getFullYear(); const month = date.getMonth() + 1; let strmMonth; month < 10 ? strmMonth = "0" + month : strmMonth = month; const day = date.getDate(); const response = await ofetch_default("http://job.hrbeu.edu.cn/HrbeuJY/Web/Employ/QueryCalendar", { query: { yearMonth: year + "-" + strmMonth } }); let link = ""; for (let i = 0, l = response.length; i < l; i++) if (response[i].day === Number(day)) link = response[i].Items[0].link; const $ = load(await ofetch_default(`${rootUrl}${link}`, { parseResponse: (txt) => txt })); return { title: "今日招聘会", link: "http://job.hrbeu.edu.cn/HrbeuJY/web", item: $("li.clearfix").toArray().map((item) => ({ title: $(item).find("span.news_tit.news_tit_s").find("a").attr("title"), description: "点击标题,登录查看招聘详情", link: $(item).find("span.news_tit.news_tit_s").find("a").attr("href") })), allowEmpty: true }; } //#endregion export { route };