rsshub
Version:
Make RSS Great Again!
62 lines (60 loc) • 2.08 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 { 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 art } from "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { t as timezone } from "./timezone-D8cuwzTY.mjs";
import path from "node:path";
import { load } from "cheerio";
//#region lib/routes/cdzjryb/project-list.ts
init_esm_shims();
const route = {
path: "/zw/projectList",
categories: ["other"],
example: "/cdzjryb/zw/projectList",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["zw.cdzjryb.com/lottery/accept/projectList", "zw.cdzjryb.com/"] }],
name: "商品住房购房登记",
maintainers: ["TonyRL"],
handler,
url: "zw.cdzjryb.com/lottery/accept/projectList"
};
async function handler() {
const url = "https://zw.cdzjryb.com/lottery/accept/projectList";
const { data: response } = await got_default(url);
const $ = load(response);
const list = $("#_projectInfo tr").toArray().map((item) => $(item).find("td").toArray().map((td) => $(td).text().trim()));
const items = await Promise.all(list.map((item) => cache_default.tryGet(`cdzjryb:zw:projectList${item[0]}`, async () => {
const { data: notice } = await got_default.post("https://zw.cdzjryb.com/lottery/accept/getProjectRule", { form: { projectUuid: item[0] } });
return {
title: item[3],
description: art(path.join(__dirname, "templates/projectList-4e6499bf.art"), {
item,
notice: notice.message
}),
link: url,
guid: `cdzjryb:zw:projectList:${item[0]}`,
pubDate: timezone(parseDate(item[8]), 8)
};
})));
return {
title: $("head title").text(),
link: url,
item: items
};
}
//#endregion
export { route };