import{t as e}from"./parse-date-BdYTmLpo.mjs";import{t}from"./invalid-parameter-DLv2wPKB.mjs";import{n}from"./playwright-1-2p8zlN.mjs";import{load as r}from"cheerio";const i=`https://cqe.uestc.edu.cn/`,a={hdyg:`xwgg/hdyg.htm`,tzgg:`xwgg/tzgg.htm`},o={hdyg:`活动预告`,tzgg:`通知公告`},s={path:`/cqe/:type?`,categories:[`university`],example:`/uestc/cqe/tzgg`,parameters:{type:"默认为 `tzgg`"},features:{requireConfig:!1,requirePuppeteer:!0,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`cqe.uestc.edu.cn/`],target:`/cqe`}],name:`文化素质教育中心`,maintainers:[`truobel`,`mobyw`],handler:c,url:`cqe.uestc.edu.cn/`,description:`| 活动预告 | 通知公告 |
| -------- | -------- |
| hdyg     | tzgg     |`};async function c(s){let c=s.req.param(`type`)||`tzgg`,l=a[c];if(!l)throw new t(`type not supported`);let u=await n(),d=await u.newPage();await d.setRequestInterception(!0),d.on(`request`,e=>{e.resourceType()===`document`||e.resourceType()===`script`?e.continue():e.abort()}),await d.goto(i+l,{waitUntil:`networkidle2`});let f=await d.content();await u.close();let p=r(f),m=p(p(`div.Newslist li`)).toArray().map(t=>(t=p(t),{title:t.find(`a`).attr(`title`),link:i+t.find(`a`).attr(`href`).slice(3),pubDate:e(t.find(`span`).text().slice(1,-1))}));return{title:`大学生文化素质教育中心-${o[c]}`,link:i,description:`电子科技大学大学生文化素质教育中心通知`,item:m}}export{s as route};