From 321c72ec78c416589a39ab32eb411f9b2e7b200d Mon Sep 17 00:00:00 2001
From: SUEPbot <114787369+SUEPbot@users.noreply.github.com>
Date: Sat, 16 Mar 2024 11:40:56 +0800
Subject: [PATCH] fix(route): shiep/rwysxy (#14735)
* fix(route): shiep/rwysxy
* fix: recover old radar rules in shiep
---
lib/routes/shiep/config.ts | 2 +-
lib/routes/shiep/index.ts | 14 +-
lib/routes/shiep/radar.ts | 317 +++++++++++++++++++++++++++++
website/docs/routes/university.mdx | 6 +-
4 files changed, 325 insertions(+), 14 deletions(-)
create mode 100644 lib/routes/shiep/radar.ts
diff --git a/lib/routes/shiep/config.ts b/lib/routes/shiep/config.ts
index eddcf6d65..b930fe4a6 100644
--- a/lib/routes/shiep/config.ts
+++ b/lib/routes/shiep/config.ts
@@ -41,7 +41,7 @@ const config = {
office: { title: '校长办公室(档案馆)', id: '389' },
rpstec: { title: '国家新能源电力系统实验教学示范中心', id: '1366' },
rsc: { title: '党委教师工作部/人事处', id: '1695' },
- rwysxy: { title: '人文艺术学院', id: '3089' },
+ rwysxy: { title: '人文艺术学院', id: '3089', listSelector: 'li.list-item', pubDateSelector: 'div.item-publishdate' },
sjc: { title: '审计处', id: '199' },
skb: { title: '马克思主义学院', id: '1736' },
slxy: { title: '数理学院', id: '2063' },
diff --git a/lib/routes/shiep/index.ts b/lib/routes/shiep/index.ts
index 283575490..7120b26a3 100644
--- a/lib/routes/shiep/index.ts
+++ b/lib/routes/shiep/index.ts
@@ -10,20 +10,14 @@ import * as path from 'node:path';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import { config } from './config';
+import { radar } from './radar';
export const route: Route = {
path: '/:type/:id?',
categories: ['university'],
example: '/shiep/news/notice',
parameters: { type: '类型名称,见下表', id: '页面 ID,默认为通知公告或学院公告所对应的 ID' },
- features: {
- requireConfig: false,
- requirePuppeteer: false,
- antiCrawler: false,
- supportBT: false,
- supportPodcast: false,
- supportScihub: false,
- },
+ radar,
name: '新闻网与学院通知',
maintainers: ['gumibea', 'TeamSUEP'],
handler,
@@ -34,7 +28,7 @@ export const route: Route = {
| 能源与机械工程学院 | 环境与化学工程学院 | 电气工程学院 | 自动化工程学院 | 计算机科学与技术学院 | 电子与信息工程学院 | 经济与管理学院 | 数理学院 | 外国语学院 | 体育学院 | 马克思主义学院 | 人文艺术学院 | 继续教育学院(国际教育学院) |
| ------------------ | ------------------ | ------------ | -------------- | -------------------- | ------------------ | -------------- | -------- | ---------- | -------- | -------------- | ------------ | ---------------------------- |
| energy | hhxy | dqxy | zdhxy | jsjxy | dxxy | jgxy | slxy | wgyxy | tyb | skb | rwysxy | jjxy |
- | 892 | 1231 | 2462 | 2002 | xygg | tzgg | 3633 | 2063 | tzgg | 2891 | 1736 | 3089 | 2582 |
+ | 892 | 5559 | 2462 | 2002 | xygg | tzgg | 3633 | 2063 | tzgg | 2891 | 1736 | 3089 | 2582 |
党群部门:
@@ -54,7 +48,7 @@ export const route: Route = {
| 新闻网 | Shanghai University of Electric Power | 信息公开网 | 本科招生网 | 本科就业信息网 | 妇工委 | 文明办 | 学习路上 | 上海热交换系统节能工程技术研究中心 | 上海新能源人才技术教育交流中心 | 上海绿色能源并网技术研究中心 | 能源化学实验教学中心 | 教师教学发展中心 | 电力装备设计与制造虚拟仿真中心 | 上海市电力材料防护与新材料重点实验室 | 能源电力智库 | 国家新能源电力系统实验教学示范中心 | 智能发电实验教学中心 |
| ------ | ------------------------------------- | ---------- | ---------- | -------------- | ------ | ------- | -------- | ---------------------------------- | ------------------------------ | ---------------------------- | -------------------- | ---------------- | ------------------------------ | ------------------------------------ | ------------ | ---------------------------------- | -------------------- |
- | news | english | xxgk | zs | career | fgw | wenming | ztjy | energy-saving | gec | green-energy | hhsyzx | jsjxfzzx | jxfz | mpep | nydlzk | restec | spgc |
+ | news | english | xxgk | zs | career | fgw | wenming | ztjy | energy-saving | gec | green-energy | hhsyzx | jsjxfzzx | jxfz | mpep | nydlzk | rpstec | spgc |
| notice | events | zxgkxx | zxxx | tzgg | 1411 | 2202 | 5575 | tzgg | 1959 | 118 | 3709 | 3909 | 3330 | 1134 | tzgg | 1366 | 4449 |
参数与来源页面对应规则为:\`https://\${type}.shiep.edu.cn/\${id}/list.htm\``,
diff --git a/lib/routes/shiep/radar.ts b/lib/routes/shiep/radar.ts
new file mode 100644
index 000000000..3dd703d46
--- /dev/null
+++ b/lib/routes/shiep/radar.ts
@@ -0,0 +1,317 @@
+export const radar = [
+ {
+ title: '武装部保卫处',
+ source: ['bwc.shiep.edu.cn/:id/list.htm'],
+ target: '/bwc/:id',
+ },
+ {
+ title: '本科就业信息网',
+ source: ['career.shiep.edu.cn/news/index/tag/:id'],
+ target: '/career/:id',
+ },
+ {
+ title: '资产经营公司/产业办',
+ source: ['cyb.shiep.edu.cn/:id/list.htm'],
+ target: '/cyb/:id',
+ },
+ {
+ title: '党委办公室',
+ source: ['dangban.shiep.edu.cn/:id/list.htm'],
+ target: '/dangban/:id',
+ },
+ {
+ title: '党建服务中心/党建督查室',
+ source: ['djfwzxdcs.shiep.edu.cn/:id/list.htm'],
+ target: '/djfwzxdcs/:id',
+ },
+ {
+ title: '电气工程学院',
+ source: ['dqxy.shiep.edu.cn/:id/list.htm'],
+ target: '/dqxy/:id',
+ },
+ {
+ title: '对外联络处',
+ source: ['dwllc.shiep.edu.cn/:id/list.htm'],
+ target: '/dwllc/:id',
+ },
+ {
+ title: '电子与信息工程学院',
+ source: ['dxxy.shiep.edu.cn/:id/list.htm'],
+ target: '/dxxy/:id',
+ },
+ {
+ title: '能源与机械工程学院',
+ source: ['energy.shiep.edu.cn/:id/list.htm'],
+ target: '/energy/:id',
+ },
+ {
+ title: '上海热交换系统节能工程技术研究中心',
+ source: ['energy-saving.shiep.edu.cn/:id/list.htm'],
+ target: '/energy-saving/:id',
+ },
+ {
+ title: 'Shanghai University of Electric Power',
+ source: ['english.shiep.edu.cn/:id/list.htm'],
+ target: '/english/:id',
+ },
+ {
+ title: '国际交流与合作处(港澳台办公室)',
+ source: ['fao.shiep.edu.cn/:id/list.htm'],
+ target: '/fao/:id',
+ },
+ {
+ title: '妇工委',
+ source: ['fgw.shiep.edu.cn/:id/list.htm'],
+ target: '/fgw/:id',
+ },
+ {
+ title: '发展规划处',
+ source: ['fzghc.shiep.edu.cn/:id/list.htm'],
+ target: '/fzghc/:id',
+ },
+ {
+ title: '上海新能源人才技术教育交流中心',
+ source: ['gec.shiep.edu.cn/:id/list.htm'],
+ target: '/gec/:id',
+ },
+ {
+ title: '工会',
+ source: ['gonghui.shiep.edu.cn/:id/list.htm'],
+ target: '/gonghui/:id',
+ },
+ {
+ title: '上海绿色能源并网技术研究中心',
+ source: ['green-energy.shiep.edu.cn/:id/list.htm'],
+ target: '/green-energy/:id',
+ },
+ {
+ title: '能源化学实验教学中心',
+ source: ['hhsyzx.shiep.edu.cn/:id/list.htm'],
+ target: '/hhsyzx/:id',
+ },
+ {
+ title: '环境与化学工程学院',
+ source: ['hhxy.shiep.edu.cn/:id/list.htm'],
+ target: '/hhxy/:id',
+ },
+ {
+ title: '后勤管理处(后勤服务中心)',
+ source: ['hqglc.shiep.edu.cn/:id/list.htm'],
+ target: '/hqglc/:id',
+ },
+ {
+ title: '创新创业工程训练中心',
+ source: ['ieetc.shiep.edu.cn/:id/list.htm'],
+ target: '/ieetc/:id',
+ },
+ {
+ title: '机关党委',
+ source: ['jgdw.shiep.edu.cn/:id/list.htm'],
+ target: '/jgdw/:id',
+ },
+ {
+ title: '经济与管理学院',
+ source: ['jgxy.shiep.edu.cn/:id/list.htm'],
+ target: '/jgxy/:id',
+ },
+ {
+ title: '纪委(监察专员办公室)',
+ source: ['jijian.shiep.edu.cn/:id/list.htm'],
+ target: '/jijian/:id',
+ },
+ {
+ title: '基建处',
+ source: ['jjc.shiep.edu.cn/:id/list.htm'],
+ target: '/jjc/:id',
+ },
+ {
+ title: '继续教育学院(国际教育学院)',
+ source: ['jjxy.shiep.edu.cn/:id/list.htm'],
+ target: '/jjxy/:id',
+ },
+ {
+ title: '教师教学发展中心',
+ source: ['jsjxfzzx.shiep.edu.cn/:id/list.htm'],
+ target: '/jsjxfzzx/:id',
+ },
+ {
+ title: '计算机科学与技术学院',
+ source: ['jsjxy.shiep.edu.cn/:id/list.htm'],
+ target: '/jsjxy/:id',
+ },
+ {
+ title: '技术转移中心',
+ source: ['jszyzx.shiep.edu.cn/:id/list.htm'],
+ target: '/jszyzx/:id',
+ },
+ {
+ title: '教务处',
+ source: ['jwc.shiep.edu.cn/:id/list.htm'],
+ target: '/jwc/:id',
+ },
+ {
+ title: '电力装备设计与制造虚拟仿真中心',
+ source: ['jxfz.shiep.edu.cn/:id/list.htm'],
+ target: '/jxfz/:id',
+ },
+ {
+ title: '能源电力科创中心',
+ source: ['kczx.shiep.edu.cn/:id/list.htm'],
+ target: '/kczx/:id',
+ },
+ {
+ title: '科研处/融合办',
+ source: ['kyc.shiep.edu.cn/:id/list.htm'],
+ target: '/kyc/:id',
+ },
+ {
+ title: '临港新校区建设综合办公室',
+ source: ['lgxq.shiep.edu.cn/:id/list.htm'],
+ target: '/lgxq/:id',
+ },
+ {
+ title: '图书馆',
+ source: ['library.shiep.edu.cn/:id/list.htm'],
+ target: '/library/:id',
+ },
+ {
+ title: '现代教育技术中心/信息办',
+ source: ['metc.shiep.edu.cn/:id/list.htm'],
+ target: '/metc/:id',
+ },
+ {
+ title: '上海市电力材料防护与新材料重点实验室',
+ source: ['mpep.shiep.edu.cn/:id/list.htm'],
+ target: '/mpep/:id',
+ },
+ {
+ title: '新闻网',
+ source: ['news.shiep.edu.cn/:id/list.htm'],
+ target: '/news/:id',
+ },
+ {
+ title: '能源电力智库',
+ source: ['nydlzk.shiep.edu.cn/:id/list.htm'],
+ target: '/nydlzk/:id',
+ },
+ {
+ title: '校长办公室(档案馆)',
+ source: ['office.shiep.edu.cn/:id/list.htm'],
+ target: '/office/:id',
+ },
+ {
+ title: '国家新能源电力系统实验教学示范中心',
+ source: ['rpstec.shiep.edu.cn/:id/list.htm'],
+ target: '/rpstec/:id',
+ },
+ {
+ title: '党委教师工作部/人事处',
+ source: ['rsc.shiep.edu.cn/:id/list.htm'],
+ target: '/rsc/:id',
+ },
+ {
+ title: '人文艺术学院',
+ source: ['rwysxy.shiep.edu.cn/:id/list.htm'],
+ target: '/rwysxy/:id',
+ },
+ {
+ title: '审计处',
+ source: ['sjc.shiep.edu.cn/:id/list.htm'],
+ target: '/sjc/:id',
+ },
+ {
+ title: '马克思主义学院',
+ source: ['skb.shiep.edu.cn/:id/list.htm'],
+ target: '/skb/:id',
+ },
+ {
+ title: '数理学院',
+ source: ['slxy.shiep.edu.cn/:id/list.htm'],
+ target: '/slxy/:id',
+ },
+ {
+ title: '智能发电实验教学中心',
+ source: ['spgc.shiep.edu.cn/:id/list.htm'],
+ target: '/spgc/:id',
+ },
+ {
+ title: '实验室与资产管理处',
+ source: ['sysyzcglc.shiep.edu.cn/:id/list.htm'],
+ target: '/sysyzcglc/:id',
+ },
+ {
+ title: '离退休党委/退管办',
+ source: ['tgb.shiep.edu.cn/:id/list.htm'],
+ target: '/tgb/:id',
+ },
+ {
+ title: '团委',
+ source: ['tw.shiep.edu.cn/:id/list.htm'],
+ target: '/tw/:id',
+ },
+ {
+ title: '体育学院',
+ source: ['tyb.shiep.edu.cn/:id/list.htm'],
+ target: '/tyb/:id',
+ },
+ {
+ title: '统战部',
+ source: ['tzb.shiep.edu.cn/:id/list.htm'],
+ target: '/tzb/:id',
+ },
+ {
+ title: '文明办',
+ source: ['wenming.shiep.edu.cn/:id/list.htm'],
+ target: '/wenming/:id',
+ },
+ {
+ title: '外国语学院',
+ source: ['wgyxy.shiep.edu.cn/:id/list.htm'],
+ target: '/wgyxy/:id',
+ },
+ {
+ title: '宣传部(文明办、融媒体中心)',
+ source: ['xcb.shiep.edu.cn/:id/list.htm'],
+ target: '/xcb/:id',
+ },
+ {
+ title: '学生处',
+ source: ['xsc.shiep.edu.cn/:id/list.htm'],
+ target: '/xsc/:id',
+ },
+ {
+ title: '巡查办',
+ source: ['xunchaban.shiep.edu.cn/:id/list.htm'],
+ target: '/xunchaban/:id',
+ },
+ {
+ title: '信息公开网',
+ source: ['xxgk.shiep.edu.cn/:id/list.htm'],
+ target: '/xxgk/:id',
+ },
+ {
+ title: '研究生院/研工部',
+ source: ['yjsc.shiep.edu.cn/:id/list.htm'],
+ target: '/yjsc/:id',
+ },
+ {
+ title: '自动化工程学院',
+ source: ['zdhxy.shiep.edu.cn/:id/list.htm'],
+ target: '/zdhxy/:id',
+ },
+ {
+ title: '本科招生网',
+ source: ['zs.shiep.edu.cn/:id/list.htm'],
+ target: '/zs/:id',
+ },
+ {
+ title: '学习路上',
+ source: ['ztjy.shiep.edu.cn/:id/list.htm'],
+ target: '/ztjy/:id',
+ },
+ {
+ title: '组织部(老干部处、党校)',
+ source: ['zzb.shiep.edu.cn/:id/list.htm'],
+ target: '/zzb/:id',
+ },
+];
diff --git a/website/docs/routes/university.mdx b/website/docs/routes/university.mdx
index da53161a6..588935b18 100644
--- a/website/docs/routes/university.mdx
+++ b/website/docs/routes/university.mdx
@@ -1306,7 +1306,7 @@ author 列表:
### 新闻网与学院通知
-
+
类型名称与默认 ID:
@@ -1315,7 +1315,7 @@ author 列表:
| 能源与机械工程学院 | 环境与化学工程学院 | 电气工程学院 | 自动化工程学院 | 计算机科学与技术学院 | 电子与信息工程学院 | 经济与管理学院 | 数理学院 | 外国语学院 | 体育学院 | 马克思主义学院 | 人文艺术学院 | 继续教育学院(国际教育学院) |
| ------------------ | ------------------ | ------------ | -------------- | -------------------- | ------------------ | -------------- | -------- | ---------- | -------- | -------------- | ------------ | ---------------------------- |
| energy | hhxy | dqxy | zdhxy | jsjxy | dxxy | jgxy | slxy | wgyxy | tyb | skb | rwysxy | jjxy |
- | 892 | 1231 | 2462 | 2002 | xygg | tzgg | 3633 | 2063 | tzgg | 2891 | 1736 | 3089 | 2582 |
+ | 892 | 5559 | 2462 | 2002 | xygg | tzgg | 3633 | 2063 | tzgg | 2891 | 1736 | 3089 | 2582 |
党群部门:
@@ -1335,7 +1335,7 @@ author 列表:
| 新闻网 | Shanghai University of Electric Power | 信息公开网 | 本科招生网 | 本科就业信息网 | 妇工委 | 文明办 | 学习路上 | 上海热交换系统节能工程技术研究中心 | 上海新能源人才技术教育交流中心 | 上海绿色能源并网技术研究中心 | 能源化学实验教学中心 | 教师教学发展中心 | 电力装备设计与制造虚拟仿真中心 | 上海市电力材料防护与新材料重点实验室 | 能源电力智库 | 国家新能源电力系统实验教学示范中心 | 智能发电实验教学中心 |
| ------ | ------------------------------------- | ---------- | ---------- | -------------- | ------ | ------- | -------- | ---------------------------------- | ------------------------------ | ---------------------------- | -------------------- | ---------------- | ------------------------------ | ------------------------------------ | ------------ | ---------------------------------- | -------------------- |
- | news | english | xxgk | zs | career | fgw | wenming | ztjy | energy-saving | gec | green-energy | hhsyzx | jsjxfzzx | jxfz | mpep | nydlzk | restec | spgc |
+ | news | english | xxgk | zs | career | fgw | wenming | ztjy | energy-saving | gec | green-energy | hhsyzx | jsjxfzzx | jxfz | mpep | nydlzk | rpstec | spgc |
| notice | events | zxgkxx | zxxx | tzgg | 1411 | 2202 | 5575 | tzgg | 1959 | 118 | 3709 | 3909 | 3330 | 1134 | tzgg | 1366 | 4449 |
参数与来源页面对应规则为:`https://${type}.shiep.edu.cn/${id}/list.htm`