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:
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
'/jw': ['Silent-wqh'],
|
||||
};
|
||||
@@ -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',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export default (router) => {
|
||||
router.get('/jw', './jw');
|
||||
};
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user