feat: add more portal types for shmtu (#11417)

This commit is contained in:
imbytecat 2022-12-09 04:21:46 +08:00 committed by GitHub
parent 90d845504f
commit de40f431c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 8 deletions

View File

@ -2352,7 +2352,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
### 官网信息
<Route author="simonsmh" example="/shmtu/www/events" path="/shmtu/www/:type" :paramsDesc="['类型名称']"/>
<Route author="imbytecat simonsmh" example="/shmtu/www/events" path="/shmtu/www/:type" :paramsDesc="['类型名称']"/>
| 学术讲座 | 通知公告 |
| ------ | ----- |
@ -2360,7 +2360,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
### 教务信息
<Route author="simonsmh" example="/shmtu/jwc/jwgg" path="/shmtu/jwc/:type" :paramsDesc="['类型名称']"/>
<Route author="imbytecat simonsmh" example="/shmtu/jwc/jwgg" path="/shmtu/jwc/:type" :paramsDesc="['类型名称']"/>
| 教务公告 | 教务新闻 |
| ---- | ---- |
@ -2370,9 +2370,9 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
<Route author="imbytecat" example="/shmtu/portal/bmtzgg" path="/shmtu/portal/:type" :paramsDesc="['类型名称']"/>
| 部门通知公告 |
| ------ |
| bmtzgg |
| 部门通知公告 | 学术与大型活动公告 | 部门动态 |
| ------ | --------- | ---- |
| bmtzgg | xsydxhdgg | bmdt |
## 上海海洋大学

View File

@ -1,5 +1,5 @@
module.exports = {
'/jwc/:type': ['simonsmh'],
'/jwc/:type': ['imbytecat', 'simonsmh'],
'/portal/:type': ['imbytecat'],
'/www/:type': ['simonsmh'],
'/www/:type': ['imbytecat', 'simonsmh'],
};

View File

@ -30,7 +30,21 @@ const processFeed = (list, caches) =>
module.exports = async (ctx) => {
const type = ctx.params.type;
const info = type === 'bmtzgg' ? '部门通知公告' : '未知';
let info;
switch (type) {
case 'bmtzgg':
info = '部门通知公告';
break;
case 'xsydxhdgg':
info = '学术与大型活动公告';
break;
case 'bmdt':
info = '部门动态';
break;
default:
info = '未知';
break;
}
const response = await got.post(bootstrapHost, {
form: {