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=new Map([[`kydt`,{title:`科研动态`,id:`2404`}],[`tzgg`,{title:`通知公告`,id:`2402`}],[`xshd`,{title:`学术活动`,id:`xshd`}],[`ynxw`,{title:`院内新闻`,id:`2405`}]]),o=`https://scms.ustc.edu.cn`,s={path:`/scms/:type?`,categories:[`university`],example:`/ustc/scms/tzgg`,parameters:{type:`分类，见下表，默认为通知公告`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`scms.ustc.edu.cn/:id/list.htm`],target:`/scms`}],name:`化学与材料科学学院`,maintainers:[`boxie123`],handler:c,url:`scms.ustc.edu.cn/`,description:`| 院内新闻 | 通知公告 | 科研动态 | 学术活动 | 其他 |
| -------- | -------- | -------- | -------- | -------- |
| ynxw     | tzgg     | kydt     | xshd     | 自定义id  |`};async function c(s){let c=s.req.param(`type`)??`tzgg`,l=a.get(c),u=l?.id??c,d=i((await n(`${o}/${u}/list.htm`)).data),f=l?.title??d(`head > title`).text(),p=d(`#wp_news_w6 > .wp_article_list > .list_item`).toArray().map(e=>{let n=d(e),i=n.find(`.Article_Title > a`).attr(`title`).trim(),a=n.find(`.Article_Title > a`).attr(`href`);return a=a.startsWith(`/`)?o+a:a,{title:i,pubDate:r(t(n.find(`.Article_PublishDate`).text(),`YYYY-MM-DD`),-4),link:a}});return p=await Promise.all(p.map(t=>e.tryGet(t.link,async()=>{let e;try{e=i((await n(t.link)).data)(`div.wp_articlecontent`).html(),t.description=e}catch{}return t}))),{title:`中国科学技术大学化学与材料科学学院 - ${f}`,link:`${o}/${u}/list.htm`,item:p}}export{s as route};