feat(route): add qust jw (#14670)

* feat(route): add qust jw

Signed-off-by: silent7wang <wqh1216dyx@qq.com>

* fix(route): use map() instead of each(), add docs in university.mdx

* Update lib/routes/qust/jw.ts

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* fix(route): Remove redundant logic.

---------

Signed-off-by: silent7wang <wqh1216dyx@qq.com>
This commit is contained in:
Silent Wang
2024-03-08 12:41:12 +08:00
committed by GitHub
co-authored by Tony
parent 031b4e8d88
commit 495cff5001
5 changed files with 55 additions and 0 deletions
+30
View File
@@ -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,
});
};
+3
View File
@@ -0,0 +1,3 @@
export default {
'/jw': ['Silent-wqh'],
};
+13
View File
@@ -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',
},
],
},
};
+3
View File
@@ -0,0 +1,3 @@
export default (router) => {
router.get('/jw', './jw');
};
+6
View File
@@ -3699,3 +3699,9 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE\_TL
| -------- | -------- | -------- | -------- |
| results | papers | writings | policy |
</Route>
## 青岛科技大学 {#qing-dao-ke-ji-da-xue}
### 教务通知 {#qing-dao-ke-ji-da-xue-jiao-wu-tong-zhi}
<Route author="Silent-wqh" example="/qust/jw" path="/qust/jw" radar="1" />