rsshub
Version:
Make RSS Great Again!
65 lines (63 loc) • 1.78 kB
JavaScript
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as art } from "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import path from "node:path";
//#region lib/routes/crac/exam.ts
init_esm_shims();
const route = {
path: "/exam",
categories: ["government"],
example: "/crac/exam",
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "考试信息",
maintainers: ["admxj"],
radar: [{
source: ["www.crac.org.cn/*"],
target: "/exam"
}],
handler
};
async function handler() {
const baseUrl = "http://82.157.138.16:8091/CRAC";
return {
title: "考试信息-中国无线电协会业余无线电分会",
link: "http://82.157.138.16:8091/CRAC/crac/pages/list_examMsg.html",
item: (await got_default({
method: "post",
url: `${baseUrl}/app/exam_advice/examAdviceList`,
body: { req: {
type: "0",
page_no: "1",
page_size: "10"
} }
})).data.res.list.map((item) => {
const link = `${baseUrl}/crac/pages/list_detail.html?id=${Buffer.from(item.id).toString("base64")}&type=${Buffer.from(item.type).toString("base64")}`;
return {
title: item.name,
link,
id: item.id,
author: item.exam.organizer,
pubDate: item.createDate,
updated: item.updateDate,
startDate: item.exam.signUpStartDate,
category: [item.examType],
image: item.weixin,
description: art(path.join(__dirname, "templates/exam-376104fd.art"), { item })
};
})
};
}
//#endregion
export { route };