diff --git a/docs/university.md b/docs/university.md index 0808756976..047941c10e 100644 --- a/docs/university.md +++ b/docs/university.md @@ -3247,6 +3247,18 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS +## 浙江中医药大学 + +### 教务处 + + + +| 成绩管理 | 学籍管理 | 考试管理 | 选课管理 | 排课管理 | +| --- | --- | --- | --- | --- | +| 1 | 2 | 3 | 4 | 5 | + + + ## 郑州大学 ### 郑州大学新闻网 diff --git a/lib/v2/zcmu/jwc/index.js b/lib/v2/zcmu/jwc/index.js new file mode 100644 index 0000000000..cf9e2137d1 --- /dev/null +++ b/lib/v2/zcmu/jwc/index.js @@ -0,0 +1,40 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +const host = 'https://jwc.zcmu.edu.cn/jwgl'; + +const map = new Map([ + [1, { title: '教务处 -- 成绩管理', id: 'cjgl' }], + [2, { title: '教务处 -- 学籍管理', id: 'xjgl' }], + [3, { title: '教务处 -- 考试管理', id: 'ksgl' }], + [4, { title: '教务处 -- 选课管理', id: 'xkgl' }], + [5, { title: '教务处 -- 排课管理', id: 'pkgl' }], +]); + +module.exports = async (ctx) => { + const type = parseInt(ctx.params.type); + const id = map.get(type).id; + const res = await got({ + method: 'get', + url: `${host}/${id}.htm`, + }); + + const $ = cheerio.load(res.data); + const items = $('.winstyle196327 tr:lt(20)') + .map((index, item) => { + item = $(item); + return { + title: item.find('a').attr('title'), + link: `https://jwc.zcmu.edu.cn/${item.find('a').attr('href')}`, + pubDate: parseDate(item.find('span.timestyle196327').text().trim()), + }; + }) + .get(); + + ctx.state.data = { + title: map.get(type).title, + link: `${host}/${id}`, + item: items, + }; +}; diff --git a/lib/v2/zcmu/maintainer.js b/lib/v2/zcmu/maintainer.js new file mode 100644 index 0000000000..1bd26dfc93 --- /dev/null +++ b/lib/v2/zcmu/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/jwc/:type?': ['CCraftY'], +}; \ No newline at end of file diff --git a/lib/v2/zcmu/radar.js b/lib/v2/zcmu/radar.js new file mode 100644 index 0000000000..90807bcd3c --- /dev/null +++ b/lib/v2/zcmu/radar.js @@ -0,0 +1,11 @@ +module.exports = { + 'zcmu.edu.cn': { + _name: '浙江中医药大学', + '.': [ + { + title: '教务处', + docs: 'https://docs.rsshub.app/university.html#zhe-jiang-zhong-yi-yao-da-xue', + }, + ], + }, +}; diff --git a/lib/v2/zcmu/router.js b/lib/v2/zcmu/router.js new file mode 100644 index 0000000000..20f2ae8d7b --- /dev/null +++ b/lib/v2/zcmu/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/jwc/:type?', require('./jwc')); +}; \ No newline at end of file