import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{load as r}from"cheerio";const i=`https://news.shisu.edu.cn`,a={path:`/news/:section`,categories:[`university`],example:`/shisu/news/news`,parameters:{section:`主站的新闻类别`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`news.shisu.edu.cn/:section/index.html`],target:`/news/:section`}],name:`上外新闻`,maintainers:[`Duuckjing`],handler:o,description:`| 首页 | 特稿    | 学术      | 教学       | 国际          | 校园   | 人物   | 视讯       | 公告   |
| ---- | ------- | --------- | ---------- | ------------- | ------ | ------ | ---------- | ------ |
| news | gazette | research- | academics- | international | campus | people | multimedia | notice |`};async function o(a){let{section:o=`news`}=a.req.param(),s=r(await e(`${i}/${o}/index.html`)),c;switch(o){case`news`:c=s(`#gallery-wrapper > article`).toArray().map(e=>{let t=s(e),n=t.find(`img`).attr(`src`);return{title:t.find(`a`).text().trim(),link:`${i}${t.find(`a`).attr(`href`)}`,category:t.find(`.in-con02 > span:nth-child(1)`).text(),itunes_item_image:`${i}${n}`}});break;default:c=s(`li.clear`).toArray().map(e=>{let t=s(e);return{title:t.find(`h3>a`).attr(`title`)?.trim(),link:`${i}${t.find(`h3>a`).attr(`href`)}`,category:t.find(`p>span:nth-child(1)`).text()}})}let l=await Promise.all(c.map(a=>t.tryGet(a.link,async()=>{let t=r(await e(a.link)),o=t(`.tempWrap > ul > li:nth-child(1)> img`).attr(`src`);return a.description=t(`.ot_main_r .content`).html(),a.author=t(`.math_time_l > span:nth-child(3)`).text().trim(),a.pubDate=n(t(`.math_time_l > span:nth-child(2)`).text(),`YYYY-MM-DD`),a.itunes_item_image||=o?`${i}${o}`:`https://news.shisu.edu.cn/news/index/39adf3d9ae414bc39c6d3b9316ae531f.png`,a})));return{title:`上外新闻|SISU TODAY - ${o.charAt(0).toUpperCase()+o.slice(1)}`,image:`https://upload.wikimedia.org/wikipedia/zh/thumb/0/06/Shanghai_International_Studies_University_logo.svg/300px-Shanghai_International_Studies_University_logo.svg.png`,link:`${i}/${o}/index.html`,item:l}}export{a as route};