rsshub
Version:
Make RSS Great Again!
53 lines (51 loc) • 1.82 kB
JavaScript
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 "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { load } from "cheerio";
//#region lib/routes/gov/zj/ningborsjnotice.ts
const route = {
path: "/zj/ningborsjnotice/:colId?",
categories: ["government"],
example: "/gov/zj/ningborsjnotice/1229676740",
parameters: { colId: "公告分类id、详细信息点击源网站http://rsj.ningbo.gov.cn/请求中寻找" },
radar: [{
source: ["rsj.ningbo.gov.cn/col/col1229676740/index.html"],
target: "/zj/ningborsjnotice/:colId?"
}],
name: "宁波市人力资源和社会保障局-公告",
url: "rsj.ningbo.gov.cn",
maintainers: ["HaoyuLee"],
description: `
| 公告类别 | colId |
| ------------ | -- |
| 事业单位进人公告 | 1229676740 |
`,
async handler(ctx) {
const { colId = "1229676740" } = ctx.req.param();
const url = `http://rsj.ningbo.gov.cn/col/col${colId}/index.html`;
const { data: response } = await got_default(url);
const noticeCate = load(response)(".titel.bgcolor01").text();
return {
title: "宁波市人力资源和社会保障局-公告",
link: url,
item: response.match(/<li class="news_line">.*<\/li>/g).map((line) => {
const $ = load(line);
const title = $(".news_titel");
return {
title: `宁波人社公告-${noticeCate}:${title.text()}`,
link: `http://rsj.ningbo.gov.cn${title.attr("href")}`,
pubDate: parseDate($(".news_date").text().replaceAll(/\[|]/g, "")),
author: "宁波市人力资源和社会保障局",
description: title.text()
};
})
};
}
};
//#endregion
export { route };