Skip to content

Commit

Permalink
Merge pull request #1302 from DIYgod/master
Browse files Browse the repository at this point in the history
[pull] master from diygod:master
  • Loading branch information
pull[bot] authored Dec 26, 2023
2 parents 6b784ed + d88a3ae commit b490cca
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions lib/v2/shiep/config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const config = {
bwc: { title: '武装部保卫处', id: 'tzgg' },
career: { title: '本科就业信息网', id: 'tzgg', listSelector: 'ul.newsList', pubDateSelector: 'li[class="span2 y"]', descriptionSelector: '.aContent' },
career: { title: '本科就业信息网', id: 'tzgg', listSelector: 'ul.newsList', pubDateSelector: 'li.span2.y', descriptionSelector: '.aContent' },
cyb: { title: '资产经营公司/产业办', id: '367' },
dangban: { title: '党委办公室', id: '4014' },
djfwzxdcs: { title: '党建服务中心/党建督查室', id: 'tzgg', listSelector: '.news', pubDateSelector: 'span[class="news_meta"]' },
djfwzxdcs: { title: '党建服务中心/党建督查室', id: 'tzgg', listSelector: 'li.news', pubDateSelector: 'span.news_meta' },
dqxy: { title: '电气工程学院', id: '2462' },
dwllc: { title: '对外联络处', id: '2649' },
dxxy: { title: '电子与信息工程学院', id: 'tzgg', pubDateSelector: 'div[class="article-publishdate"]' },
dxxy: { title: '电子与信息工程学院', id: 'tzgg', pubDateSelector: 'div.article-publishdate' },
energy: { title: '能源与机械工程学院', id: '892' },
'energy-saving': { title: '上海热交换系统节能工程技术研究中心', id: 'tzgg' },
english: { title: 'Shanghai University of Electric Power', id: 'events' },
Expand All @@ -17,24 +17,24 @@ const config = {
gonghui: { title: '工会', id: '1806', listSelector: 'table.wp_article_list_table tr', pubDateSelector: 'td[align="right"]' },
'green-energy': { title: '上海绿色能源并网技术研究中心', id: '118' },
hhsyzx: { title: '能源化学实验教学中心', id: '3709' },
hhxy: { title: '环境与化学工程学院', id: '1231' },
hhxy: { title: '环境与化学工程学院', id: '5559', listSelector: 'li.list-item', pubDateSelector: 'div.item-publishdate' },
hqglc: { title: '后勤管理处(后勤服务中心)', id: '1616' },
ieetc: { title: '创新创业工程训练中心', id: 'cxcy', pubDateSelector: 'div[class="article-publishdate"]' },
ieetc: { title: '创新创业工程训练中心', id: 'cxcy', pubDateSelector: 'div.article-publishdate' },
jgdw: { title: '机关党委', id: '3205' },
jgxy: { title: '经济与管理学院', id: '3633' },
jijian: { title: '纪委(监察专员办公室)', id: '59' },
jjc: { title: '基建处', id: '327' },
jjxy: { title: '继续教育学院(国际教育学院)', id: '2582' },
jsjxfzzx: { title: '教师教学发展中心', id: '3909' },
jsjxy: { title: '计算机科学与技术学院', id: 'xygg', listSelector: 'div.xy-service-text', pubDateSelector: 'span' },
jsjxy: { title: '计算机科学与技术学院', id: 'xygg', listSelector: 'div.post-entry-2', pubDateSelector: 'span:nth-child(2)' },
jszyzx: { title: '技术转移中心', id: '4247' },
jwc: { title: '教务处', id: '227' },
jxfz: { title: '电力装备设计与制造虚拟仿真中心', id: '3330' },
kczx: { title: '能源电力科创中心', id: '3946' },
kyc: { title: '科研处/融合办', id: '834' },
lgxq: { title: '临港新校区建设综合办公室', id: '377' },
library: { title: '图书馆', id: '4866' },
metc: { title: '现代教育技术中心/信息办', id: 'tzgg', pubDateSelector: 'div[class="article-publishdate"]' },
metc: { title: '现代教育技术中心/信息办', id: 'tzgg', pubDateSelector: 'div.article-publishdate' },
mpep: { title: '上海市电力材料防护与新材料重点实验室', id: '1134' },
news: { title: '新闻网', id: 'notice' },
nydlzk: { title: '能源电力智库', id: 'tzgg' },
Expand All @@ -47,9 +47,9 @@ const config = {
slxy: { title: '数理学院', id: '2063' },
spgc: { title: '智能发电实验教学中心', id: '4449' },
sysyzcglc: { title: '实验室与资产管理处', id: '312' },
tgb: { title: '离退休党委/退管办', id: 'notice', pubDateSelector: 'div[class="article-publishdate"]' },
tgb: { title: '离退休党委/退管办', id: 'notice', pubDateSelector: 'div.article-publishdate' },
tw: { title: '团委', id: '2092' },
tyb: { title: '体育学院', id: '2891', pubDateSelector: 'div[class="article-publishdate"]' },
tyb: { title: '体育学院', id: '2891', pubDateSelector: 'div.article-publishdate' },
tzb: { title: '统战部', id: '3858' },
wenming: { title: '文明办', id: '2202' },
wgyxy: { title: '外国语学院', id: 'tzgg' },
Expand All @@ -59,8 +59,8 @@ const config = {
xxgk: { title: '信息公开网', id: 'zxgkxx' },
yjsc: { title: '研究生院/研工部', id: '1161' },
zdhxy: { title: '自动化工程学院', id: '2002' },
ztjy: { title: '学习路上', id: '5575' },
zs: { title: '本科招生网', id: 'zxxx' },
ztjy: { title: '学习路上', id: '5575' },
zzb: { title: '组织部(老干部处、党校)', id: '1534' },
};

Expand Down
8 changes: 4 additions & 4 deletions lib/v2/shiep/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ module.exports = async (ctx) => {
const $ = cheerio.load(response.data);

const listSelector = config[type].listSelector || '.list_item';
const pubDateSelector = config[type].pubDateSelector || 'span[class="Article_PublishDate"]';
const pubDateSelector = config[type].pubDateSelector || '.Article_PublishDate';
const descriptionSelector = config[type].descriptionSelector || '.wp_articlecontent';

const items = $(listSelector)
const list = $(listSelector)
.toArray()
.filter((item) => {
const date = dayjs($(item).find(pubDateSelector).text().trim());
Expand All @@ -39,8 +39,8 @@ module.exports = async (ctx) => {
};
});

await Promise.all(
items.map((item) =>
const items = await Promise.all(
list.map((item) =>
ctx.cache.tryGet(item.link, async () => {
try {
const response = await got(item.link);
Expand Down
12 changes: 6 additions & 6 deletions lib/v2/shiep/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,20 +481,20 @@ module.exports = {
target: '/shiep/zdhxy/:id',
},
],
ztjy: [
zs: [
{
title: '学习路上',
title: '本科招生网',
docs: 'https://docs.rsshub.app/routes/university#shang-hai-dian-li-da-xue',
source: ['/:id/list.htm'],
target: '/shiep/ztjy/:id',
target: '/shiep/zs/:id',
},
],
zs: [
ztjy: [
{
title: '本科招生网',
title: '学习路上',
docs: 'https://docs.rsshub.app/routes/university#shang-hai-dian-li-da-xue',
source: ['/:id/list.htm'],
target: '/shiep/zs/:id',
target: '/shiep/ztjy/:id',
},
],
zzb: [
Expand Down

0 comments on commit b490cca

Please sign in to comment.