diff --git a/docs/en/programming.md b/docs/en/programming.md index 3a653b03a..62cb51655 100644 --- a/docs/en/programming.md +++ b/docs/en/programming.md @@ -10,12 +10,6 @@ pageClass: routes -## ACM-ECNU - -### ECNU ACM Online-Judge contests list - - - ## AtCoder ### Present Contests diff --git a/docs/en/university.md b/docs/en/university.md index 58624fb22..f90476705 100644 --- a/docs/en/university.md +++ b/docs/en/university.md @@ -18,6 +18,12 @@ pageClass: routes Note: [Source website](https://gs.bjtu.edu.cn/) only provides articles in Chinese. +## East China Normal University + +### ACM Online-Judge contests list + + + ## MIT ### MIT OCW Most popular courses of the month diff --git a/docs/other.md b/docs/other.md index 38fe6ef34..c3a8f8d6e 100644 --- a/docs/other.md +++ b/docs/other.md @@ -524,7 +524,7 @@ type 为 all 时,category 参数不支持 cost 和 free ### 考研帮调剂信息 - + ## 空气质量 diff --git a/docs/programming.md b/docs/programming.md index 83a488819..bc2f876ad 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -10,12 +10,6 @@ pageClass: routes -## ACM-ECNU 比赛 - -### 华东师范大学 ACM OJ 比赛列表 - - - ## AI 研习社 ### 首页 diff --git a/docs/university.md b/docs/university.md index de3c0598c..3f2256893 100644 --- a/docs/university.md +++ b/docs/university.md @@ -1069,7 +1069,7 @@ xskb1 对应 ## 广州大学研招网通知公告 - + ## 广州航海学院 @@ -1422,7 +1422,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 华东理工大学研究生院通知公告 - + ### 华东理工继续教育学院新闻公告 @@ -1430,15 +1430,19 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ## 华东师范大学 -### 华东师范大学研究生院 +### ACM OJ 比赛列表 - + + +### 研究生院 + + ## 华南理工大学 ### 研究生院通知公告 - + ### 教务处通知公告 @@ -1480,11 +1484,11 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 软件学院通知公告 - + ### 研究生院通知公告 - + ### 教务处通知 @@ -1502,7 +1506,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 华中科技大学研究生院通知公告 - + ### 人工智能和自动化学院通知 @@ -1522,15 +1526,15 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 华中师范大学研究生通知公告 - + ### 华中师范大学计算机学院 - + ### 华中师范大学伍论贡学院 - + ### 就业信息 @@ -1731,7 +1735,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 南方科技大学研究生网通知公告 - + ### 南方科技大学新闻网(中文) @@ -2482,7 +2486,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 深圳大学研究生招生网通知公告 - + ### 深圳大学研究生招生网 @@ -2630,7 +2634,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 同济大学研究生院通知公告 - + ### 同济大学软件学院通知 @@ -3319,11 +3323,11 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 中国海洋大学研究生院 - + ### 中国海洋大学信电学院通知公告 - + ## 中国科学技术大学 @@ -3427,11 +3431,11 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 中国农业大学研招网通知公告 - + #### 中国农业大学信电学院 - + ## 中国人民大学 @@ -3453,7 +3457,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 中国石油大学研究生院通知公告 - + ### 主页 @@ -3491,11 +3495,11 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 中科院自动化所 - + ### 中科院人工智能所 - + ## 中南财经政法大学 diff --git a/lib/router.js b/lib/router.js index 310d8815d..ca0d3a585 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2578,8 +2578,8 @@ router.get('/zkyyjs', lazyloadRouteHandler('./routes/universities/zkyyjs/zkyyjs' // 中国海洋大学信电学院 router.get('/outele', lazyloadRouteHandler('./routes/universities/outele/outele')); -// 华东师范大学研究生院 -router.get('/ecnuyjs', lazyloadRouteHandler('./routes/universities/ecnuyjs/ecnuyjs')); +// 华东师范大学研究生院 migrated to v2 +// router.get('/ecnuyjs', lazyloadRouteHandler('./routes/universities/ecnuyjs/ecnuyjs')); // 考研帮调剂信息 router.get('/kaoyan', lazyloadRouteHandler('./routes/kaoyan/kaoyan')); diff --git a/lib/routes/universities/ecnuyjs/ecnuyjs.js b/lib/routes/universities/ecnuyjs/ecnuyjs.js deleted file mode 100644 index 99170de5e..000000000 --- a/lib/routes/universities/ecnuyjs/ecnuyjs.js +++ /dev/null @@ -1,23 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const link = 'http://yz.kaoyan.com/ecnu/tiaoji/'; - const response = await got.get(link); - const $ = cheerio.load(response.data); - const list = $('.subList li').slice(0, 10); - - ctx.state.data = { - title: '华东师范大学研究生院', - link, - description: '华东师范大学研究生调剂信息', - item: - list && - list - .map((index, item) => { - item = $(item); - return { title: item.find('li a').text(), description: item.find('li a').text(), link: item.find('li a').attr('href') }; - }) - .get(), - }; -}; diff --git a/lib/v2/acm-ecnu/maintainer.js b/lib/v2/acm-ecnu/maintainer.js deleted file mode 100644 index 47635a96c..000000000 --- a/lib/v2/acm-ecnu/maintainer.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - '/contest/:category?': ['a180285'], -}; diff --git a/lib/v2/acm-ecnu/radar.js b/lib/v2/acm-ecnu/radar.js deleted file mode 100644 index 308397d86..000000000 --- a/lib/v2/acm-ecnu/radar.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - 'ecnu.edu.cn': { - _name: 'ACM-ECNU', - acm: [ - { - title: '所有比赛列表', - docs: 'https://docs.rsshub.app/programming.html#ACM-ECNU', - source: ['/contest/'], - target: '/acm-ecnu/contest/', - }, - { - title: '仅公开比赛列表', - docs: 'https://docs.rsshub.app/programming.html#ACM-ECNU', - source: ['/contest/'], - target: '/acm-ecnu/contest/public', - }, - ], - }, -}; diff --git a/lib/v2/acm-ecnu/router.js b/lib/v2/acm-ecnu/router.js deleted file mode 100644 index f6dca74cc..000000000 --- a/lib/v2/acm-ecnu/router.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (router) { - router.get('/contest/:category?', require('./contest')); -}; diff --git a/lib/v2/acm-ecnu/contest.js b/lib/v2/ecnu/contest.js similarity index 93% rename from lib/v2/acm-ecnu/contest.js rename to lib/v2/ecnu/contest.js index da5169496..78cb7791e 100644 --- a/lib/v2/acm-ecnu/contest.js +++ b/lib/v2/ecnu/contest.js @@ -9,10 +9,7 @@ module.exports = async (ctx) => { const rootUrl = 'https://acm.ecnu.edu.cn'; const currentUrl = `${rootUrl}/contest/`; - const response = await got({ - method: 'get', - url: currentUrl, - }); + const response = await got(currentUrl); const $ = cheerio.load(response.data); const $trList = $('div > div > table > tbody > tr'); diff --git a/lib/v2/ecnu/maintainer.js b/lib/v2/ecnu/maintainer.js new file mode 100644 index 000000000..75641c9bc --- /dev/null +++ b/lib/v2/ecnu/maintainer.js @@ -0,0 +1,4 @@ +module.exports = { + '/acm/contest/:category?': ['a180285'], + '/yjs': ['shengmaosu'], +}; diff --git a/lib/v2/ecnu/radar.js b/lib/v2/ecnu/radar.js new file mode 100644 index 000000000..89a2f4031 --- /dev/null +++ b/lib/v2/ecnu/radar.js @@ -0,0 +1,30 @@ +module.exports = { + 'ecnu.edu.cn': { + _name: '华东师范大学', + acm: [ + { + title: '所有比赛列表', + docs: 'https://docs.rsshub.app/university.html#hua-dong-shi-fan-da-xue', + source: ['/contest/', '/'], + target: '/ecnu/acm/contest/', + }, + { + title: '仅公开比赛列表', + docs: 'https://docs.rsshub.app/university.html#hua-dong-shi-fan-da-xue', + source: ['/contest/', '/'], + target: '/ecnu/acm/contest/public', + }, + ], + }, + 'kaoyan.com': { + _name: '华东师范大学', + yz: [ + { + title: '研究生院', + docs: 'https://docs.rsshub.app/university.html#hua-dong-shi-fan-da-xue', + source: ['/ecnu/tiaoji', '/'], + target: '/ecnu/yjs', + }, + ], + }, +}; diff --git a/lib/v2/ecnu/router.js b/lib/v2/ecnu/router.js new file mode 100644 index 000000000..63d8c3135 --- /dev/null +++ b/lib/v2/ecnu/router.js @@ -0,0 +1,4 @@ +module.exports = function (router) { + router.get('/acm/contest/:category?', require('./contest')); + router.get('/yjs', require('./yjs')); +}; diff --git a/lib/v2/acm-ecnu/templates/description.art b/lib/v2/ecnu/templates/description.art similarity index 100% rename from lib/v2/acm-ecnu/templates/description.art rename to lib/v2/ecnu/templates/description.art diff --git a/lib/v2/ecnu/yjs.js b/lib/v2/ecnu/yjs.js new file mode 100644 index 000000000..e61c467aa --- /dev/null +++ b/lib/v2/ecnu/yjs.js @@ -0,0 +1,37 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const link = 'https://yz.kaoyan.com/ecnu/tiaoji/'; + const response = await got(link); + const $ = cheerio.load(response.data); + const list = $('.subList li') + .toArray() + .map((item) => { + item = $(item); + return { + title: item.find('li a').text(), + link: item.find('li a').attr('href').replace('http:', 'https:'), + }; + }); + + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const { data: response } = await got(item.link); + const $ = cheerio.load(response); + item.description = $('.articleCon').html(); + item.pubDate = parseDate($('.outer_utime').text()); + return item; + }) + ) + ); + + ctx.state.data = { + title: '华东师范大学研究生院', + link, + description: '华东师范大学研究生调剂信息', + item: items, + }; +};