UNPKG

rsshub

Version:
42 lines (41 loc) 1.6 kB
import { t as rofetch } from "./ofetch-C3ts-Hud.mjs"; import { t as cache_default } from "./cache-BkqOokyU.mjs"; //#region lib/routes/zjgtjy/index.ts const route = { path: "/:type?", categories: ["government"], example: "/zjgtjy/all", parameters: { type: "分类名" }, name: "公告信息", maintainers: ["Fatpandac"], description: `| 全部公告 | 挂牌公告 | 拍卖公告 | 补充公告 | | :------: | :------: | :------: | :------: | | all | gpgg | pmgg | bcgg |`, handler }; async function handler(ctx) { const host = `https://td.zjgtjy.cn:8553/devops/noticeInfo/queryNoticeInfoList?pageSize=10&pageNumber=1&noticeType=${ctx.req.param("type") === "all" ? "" : ctx.req.param("type").toUpperCase()}&sort=DESC`; const data = (await rofetch(host)).data; return { title: "浙江土地使用权挂牌公告", link: host, item: await Promise.all(data.map(async (item) => { const pageUrl = `https://td.zjgtjy.cn:8553/devops/noticeInfo/queryNoticeLandContentDetails?noticeId=${item.GGID}&transactionMode=${item.JYFS}`; const pageLink = `https://td.zjgtjy.cn/view/trade/announcement/detail?id=${item.GGID}&category=${item.ZYLB}&type=${item.JYFS}`; const desc = await cache_default.tryGet(pageUrl, async () => { let desc = await rofetch(pageUrl); desc = desc.queryNoticeContent.GGNR; desc = desc.replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&quot;", "\""); return desc; }); return { title: item.GGMC, description: desc, link: pageLink, pubDate: item.GGFBSJ }; })) }; } //#endregion export { route };