diff --git a/lib/routes/qust/jw.ts b/lib/routes/qust/jw.ts new file mode 100644 index 000000000..cdfed6316 --- /dev/null +++ b/lib/routes/qust/jw.ts @@ -0,0 +1,30 @@ +import got from '@/utils/got'; +import { load } from 'cheerio'; + +const baseUrl = 'https://jw.qust.edu.cn/'; + +export default async (ctx) => { + const response = await got({ + method: 'get', + url: `${baseUrl}jwtz.htm`, + }); + const $ = load(response.data); + const items = $('.winstyle60982 tr a.c60982').map((_, element) => { + const linkElement = $(element); + const itemTitle = linkElement.text().trim(); + const path = linkElement.attr('href'); + const itemUrl = path.startsWith('http') ? path : `${baseUrl}${path}`; + return { + title: itemTitle, + link: itemUrl, + }; + }).get(); + + ctx.set('data', { + title: '青岛科技大学 - 教务通知', + link: `${baseUrl}jwtz.htm`, + item: items, + }); +}; + + diff --git a/lib/routes/qust/maintainer.ts b/lib/routes/qust/maintainer.ts new file mode 100644 index 000000000..0f581dab3 --- /dev/null +++ b/lib/routes/qust/maintainer.ts @@ -0,0 +1,3 @@ +export default { + '/jw': ['Silent-wqh'], +}; diff --git a/lib/routes/qust/radar.ts b/lib/routes/qust/radar.ts new file mode 100644 index 000000000..d249ba0fa --- /dev/null +++ b/lib/routes/qust/radar.ts @@ -0,0 +1,13 @@ +export default { + 'qust.edu.cn': { + _name: '青岛科技大学', + jw: [ + { + title: '教务通知', + docs: 'https://docs.rsshub.app/routes/university#qing-dao-ke-ji-da-xue', + source: ['/jwtz.htm', '/'], + target: '/qust/jw', + }, + ], + }, +}; diff --git a/lib/routes/qust/router.ts b/lib/routes/qust/router.ts new file mode 100644 index 000000000..3a69b3ed0 --- /dev/null +++ b/lib/routes/qust/router.ts @@ -0,0 +1,3 @@ +export default (router) => { + router.get('/jw', './jw'); +}; diff --git a/website/docs/routes/university.mdx b/website/docs/routes/university.mdx index 47edeb617..e0ba11e79 100644 --- a/website/docs/routes/university.mdx +++ b/website/docs/routes/university.mdx @@ -3699,3 +3699,9 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE\_TL | -------- | -------- | -------- | -------- | | results | papers | writings | policy | + +## 青岛科技大学 {#qing-dao-ke-ji-da-xue} + +### 教务通知 {#qing-dao-ke-ji-da-xue-jiao-wu-tong-zhi} + +