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:`/news/:category?`,categories:[`government`],example:`/casssp/news/3`,parameters:{category:`分类，见下表，默认为通知公告`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`研究会动态`,maintainers:[`nczitzk`],handler:a,description:`| 通知公告 | 新闻动态 | 信息公开 | 时政要闻 |
| -------- | -------- | -------- | -------- |
| 3        | 2        | 92       | 93       |`};async function a(i){let{category:a=`3`}=i.req.param(),o=i.req.query(`limit`)?Number.parseInt(i.req.query(`limit`),10):15,s=`http://www.casssp.org.cn`,c=new URL(`news/${a}/`,s).href,{data:l}=await n(c),u=r(l),d=u(`p.e_text-22.s_title a, p.e_text-18.s_title a`).slice(0,o).toArray().map(e=>(e=u(e),{title:e.text(),link:new URL(e.prop(`href`),s).href}));d=await Promise.all(d.map(i=>e.tryGet(i.link,async()=>{let{data:e}=await n(i.link),a=r(e);return i.description=a(`div.e_richText-25, div.e_richText-3`).html(),i.pubDate=t(`${a(`p.e_timeFormat-15`).text()}-${a(`p.e_timeFormat-14`).text()}-${a(`p.e_timeFormat-11`).text()}`),i})));let f=u(`img[la="la"]`).first().prop(`src`),p=new URL(u(`link[rel="shortcut icon "]`).prop(`href`),s).href;return{item:d,title:u(`title`).text(),link:c,description:u(`meta[name="description"]`).prop(`content`),language:u(`html`).prop(`lang`),image:f,icon:p,logo:p,subtitle:u(`meta[name="keywords"]`).prop(`content`),author:u(`img[la="la"]`).first().prop(`title`),allowEmpty:!0}}export{i as route};