import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{load as r}from"cheerio";const i={path:`/hebei/czt/xwdt/:category?`,categories:[`government`],example:`/gov/hebei/czt/xwdt`,parameters:{category:`分类，见下表，默认为财政动态`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`财政厅`,maintainers:[`nczitzk`],handler:a,description:`| 财政动态 | 综合新闻 | 通知公告 |
| -------- | -------- | -------- |
| gzdt     | zhxw     | tzgg     |`};async function a(i){let a=i.req.param(`category`)??`gzdt`,o=`http://czt.hebei.gov.cn`,s=`${o}/xwdt/${a}`,c=r((await n({method:`get`,url:s})).data),l=c(`td li a[title]`).toArray().map(e=>(e=c(e),{title:e.text(),link:`${o}${e.attr(`href`).startsWith(`../..`)?e.attr(`href`).replace(/^\.\.\/\.\./,``):`/xwdt/${a}${e.attr(`href`).replace(/^\./,``)}`}`}));return l=await Promise.all(l.map(i=>e.tryGet(i.link,async()=>{let e=r((await n({method:`get`,url:i.link})).data);return i.author=e(`meta[name="ContentSource"]`).attr(`content`),i.pubDate=t(e(`meta[name="PubDate"]`).attr(`content`)),i.description=e(`.TRS_Editor, .content`).html(),i}))),{title:c(`title`).text(),link:s,item:l}}export{i as route};