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{t as i}from"./utils-DoRV6VMM.mjs";import{load as a}from"cheerio";const o={path:`/bgw/:code`,categories:[`university`],example:`/swpu/bgw/zytzgg`,parameters:{code:`栏目代码`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`swpu.edu.cn/`],target:``}],name:`办公网`,maintainers:[`CYTMWIA`],handler:s,url:`swpu.edu.cn/`,description:`| 栏目 | 重要通知公告 | 部门通知公告 | 本周活动 |
| ---- | ------------ | ------------ | -------- |
| 代码 | zytzgg       | bmtzgg       | bzhd     |`};async function s(o){let s=`https://www.swpu.edu.cn/bgw/${o.req.param(`code`)}.htm`,c=a((await n.get(s)).data),l=c(`.title`).text(),u=c(`.notice > ul > li > a`).toArray().map(e=>({title:c(e.children[0]).text(),pubDate:r(t(c(e.children[1]).text()),8),link:i(`https://www.swpu.edu.cn`,c(e).attr(`href`))})),d=await Promise.all(u.map(async t=>await e.tryGet(t.link,async()=>{let e=a((await n.get(t.link)).data);if(e(`title`).text().startsWith(`系统提示`))t.author=`系统`,t.description=`无权访问`;else{t.author=`办公网`,t.description=e(`.v_news_content`).html();for(let n of e(`.v_news_content p`))if(e(n).css(`text-align`)===`right`){t.author=e(n).text();break}}return t})));return{title:`西南石油大学办公网 ${l}`,link:s,description:`西南石油大学办公网 ${l} 列表`,language:`zh-CN`,item:d}}export{o as route};