import{t as e}from"./got-BBDj7u1e.mjs";const t={path:`/hots/:type?`,categories:[`bbs`],example:`/nowcoder/hots/1?limit=20`,parameters:{type:"热榜类型，`1` 指热议话题，`2` 指全站热贴，默认为 `1`"},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`mnowpick.nowcoder.com/m/discuss/hot`]}],name:`牛客热榜`,description:`牛客热榜，包括热议话题和全站热贴`,maintainers:[`xia0ne`],handler:n,url:`nowcoder.com/`};async function n(t){let n=t.req.param(`type`)??`1`,r=Number.parseInt(t.req.query(`limit`)??`20`,10),i=Number.isFinite(r)&&r>0?r:20,a;if(n===`1`){a=`https://gw-c.nowcoder.com/api/sparta/subject/hot-subject?limit=${i}&_=${Date.now()}&t=`;let t=(await e.get(a)).data;if(t.code!==0)throw Error(`接口错误，错误代码:${t.code},错误原因:${t.msg}`);return{title:`牛客网-热议话题`,link:`https://mnowpick.nowcoder.com/m/discuss/hot`,description:`牛客网-热议话题`,item:t.data.result.map(e=>({title:e.content,description:`<img src="${e.numberIcon}" alt="rank">`,link:`https://www.nowcoder.com/creation/subject/${e.uuid}`}))}}else if(n===`2`){a=`https://gw-c.nowcoder.com/api/sparta/hot-search/top-hot-pc?size=${i}&_=${Date.now()}&t=`;let t=(await e.get(a)).data;if(t.code!==0)throw Error(`接口错误，错误代码: ${t.code}，错误原因: ${t.msg}`);return{title:`牛客网-全站热贴`,link:`https://mnowpick.nowcoder.com/m/discuss/hot`,description:`牛客网-全站热贴`,item:t.data.result.map(e=>({title:e.title,link:`https://www.nowcoder.com/feed/main/detail/${e.uuid}`}))}}else throw Error(`Invalid type parameter`)}export{t as route};