import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{t as r}from"./timezone-keeL11Io.mjs";import{load as i}from"cheerio";const a={path:`/:id?`,categories:[`finance`],example:`/nbd`,parameters:{id:`分类 id，见下表，默认为要闻`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`nbd.com.cn/`,`nbd.com.cn/columns/:id?`]}],name:`分类`,maintainers:[`nczitzk`],handler:o,url:`nbd.com.cn/`,description:`| 头条 | 要闻 | 图片新闻 | 推荐 |
| ---- | ---- | -------- | ---- |
| 2    | 3    | 4        | 5    |`};async function o(a){let o=a.req.param(`id`)??`3`,s=`https://www.nbd.com.cn`,c=`${s}/columns/${o}/`,l=i((await n({method:`get`,url:c})).data),u=l(`.u-news-title a`).toArray().map(e=>(e=l(e),{title:e.text(),link:e.attr(`href`)})),d=await Promise.all(u.map(a=>e.tryGet(a.link,async()=>{let e=await n({method:`get`,url:a.link});return e.url.startsWith(`${s}/`)?(a.description=i(e.data)(`.g-articl-text`).html(),a.pubDate=r(t(e.data.match(/"pubDate": "(.*)"/)[1]),8),a):a})));return{title:`${l(`h1`).text()||l(`.u-channelname`).text()} - 每经网`,link:c,item:d}}export{a as route};