rsshub
Version:
Make RSS Great Again!
45 lines (44 loc) • 1.36 kB
JavaScript
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs";
import { t as parseDate } from "./parse-date-CjhZE69i.mjs";
import { t as cache_default } from "./cache-CiDoUSLo.mjs";
import { load } from "cheerio";
//#region lib/routes/tsinghua/career.ts
const baseUrl = "https://career.cic.tsinghua.edu.cn/";
const route = {
path: "/career",
categories: ["university"],
example: "/tsinghua/career",
name: "招聘信息",
maintainers: ["Halcao", "DylanXie123"],
handler
};
async function handler() {
const link = "https://career.cic.tsinghua.edu.cn/xsglxt/f/jyxt/anony/xxfb";
const $ = load(await rofetch(link, {
method: "POST",
body: new URLSearchParams({ pgno: "1" })
}));
const list = $("#ts_div .list li").toArray().map((item) => {
const $item = $(item);
const a = $item.find("a");
return {
title: a.text(),
link: new URL(a.attr("ahref"), baseUrl).href,
pubDate: parseDate($item.find("span").text())
};
});
return {
title: "清华大学 - 招聘信息",
link,
description: "清华大学学生职业发展指导中心 - 招聘信息",
item: await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => {
const $detail = load(await rofetch(item.link));
return {
...item,
description: $detail("div.sideleft.left, div.content.teacher").html()
};
})))
};
}
//#endregion
export { route };