diff --git a/docs/README.md b/docs/README.md index d4d709a2db..cb837add84 100755 --- a/docs/README.md +++ b/docs/README.md @@ -2072,6 +2072,32 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet +### 浙江大学 + + + +| 全部公告 | 教学管理 | 各类资助 | 学科建设 | 海外交流 | +| -------- | -------- | -------- | -------- | -------- | +| 1 | 2 | 3 | 4 | 5 | + + + + + +| 新闻动态 | 活动通知 | 学院通知 | 告示通知 | +| -------- | -------- | -------- | -------- | +| 1 | 2 | 3 | 4 | + + + + + +| 本系动态 | 科研通知 | 研究生教育最新消息 | 学生思政最新消息 | 研究生思政消息公告 | 研究生奖助学金 | 研究生思政就业信息 | 本科生思政消息公告 | 本科生奖助学金 | 本科生就业信息 | +| -------- | -------- | ------------------ | ---------------- | ------------------ | -------------- | ------------------ | ------------------ | -------------- | -------------- | +| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | + + + ## 传统媒体 ### 央视新闻 diff --git a/lib/router.js b/lib/router.js index 436e7d6664..69440da29a 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1192,4 +1192,9 @@ router.get('/gamersky/news', require('./routes/gamersky/news')); // 游研社 router.get('/yystv/recommend/', require('./routes/yystv/recommend')); +// 浙江大学 +router.get('/zju/physics/:type', require('./routes/universities/zju/physics')); +router.get('/zju/grs/:type', require('./routes/universities/zju/grs')); +router.get('/zju/career/:type', require('./routes/universities/zju/career')); + module.exports = router; diff --git a/lib/routes/universities/zju/career/index.js b/lib/routes/universities/zju/career/index.js new file mode 100644 index 0000000000..1853e61b60 --- /dev/null +++ b/lib/routes/universities/zju/career/index.js @@ -0,0 +1,54 @@ +const axios = require('../../../../utils/axios'); +const cheerio = require('cheerio'); +const host = 'http://www.career.zju.edu.cn/jyxt/jygz/new/getContent.zf?minCount=0&maxCount=10&lmjdid=739BEBB72A072B25E0538713470A6C41&sjlmid=undefined&lmtype=2&lx=2&_='; + +const map = new Map([ + [1, { title: '浙大就业服务平台 -- 新闻动态', id: '1553156316534' }], + [2, { title: '浙大就业服务平台 -- 活动通知', id: '1553156316535' }], + [3, { title: '浙大就业服务平台 -- 学院动态', id: '1553156316536' }], + [4, { title: '浙大就业服务平台 -- 告示通告', id: '1553156316537' }], +]); + +// http://www.career.zju.edu.cn/jyxt/jygz/new/getContent.zf?minCount=0&maxCount=10&lmjdid=739BEBB72A072B25E0538713470A6C41&sjlmid=undefined&lmtype=2&lx=2&_=1553156316534 + +// http://www.career.zju.edu.cn/jyxt/jygz/new/getContent.zf?minCount=0&maxCount=10&lmjdid=739BEBB72A0B2B25E0538713470A6C41&sjlmid=undefined&lmtype=2&lx=2&_=1553156316535 + +// http://www.career.zju.edu.cn/jyxt/jygz/new/getContent.zf?minCount=0&maxCount=10&lmjdid=739BEBB72A0C2B25E0538713470A6C41&sjlmid=undefined&lmtype=2&lx=2&_=1553156316536 + +// http://www.career.zju.edu.cn/jyxt/jygz/new/getContent.zf?minCount=0&maxCount=10&lmjdid=739BEBB72A252B25E0538713470A6C41&sjlmid=undefined&lmtype=2&lx=2&_=1553156316537 + +module.exports = async (ctx) => { + const type = Number.parseInt(ctx.params.type); + const id = map.get(type).id; + const res = await axios({ + method: 'get', + url: host + `${id}`, + }); + + const $ = cheerio.load(res.data); + const list = $('.com-list') + .find('li') + .slice(0, 10); + const items = + list && + list + .map((index, item) => { + item = $(item); + return { + // title: item.find('a').attr('title'), + title: item.find('.news-ctn').text(), + pubDate: new Date(item.find('.new-time').text()).toUTCString(), + link: `www.career.zju.edu.cn/${item + .find('a') + .eq(0) + .attr('href')}`, + }; + }) + .get(); + + ctx.state.data = { + title: map.get(type).title, + link: host + `${id}`, + item: items, + }; +}; diff --git a/lib/routes/universities/zju/grs/index.js b/lib/routes/universities/zju/grs/index.js new file mode 100644 index 0000000000..6ea162aa8b --- /dev/null +++ b/lib/routes/universities/zju/grs/index.js @@ -0,0 +1,49 @@ +const axios = require('../../../../utils/axios'); +const cheerio = require('cheerio'); + +const host = 'http://grs.zju.edu.cn/redir.php?catalog_id=16313'; + +const map = new Map([ + [1, { title: '浙大研究生院 -- 全部公告', tag: '' }], + [2, { title: '浙大研究生院 -- 教学管理', tag: '&tag=%E6%95%99%E5%AD%A6%E7%AE%A1%E7%90%86' }], + [3, { title: '浙大研究生院 -- 各类资助', tag: '&tag=%E5%90%84%E7%B1%BB%E8%B5%84%E5%8A%A9' }], + [4, { title: '浙大研究生院 -- 学科建设', tag: '&tag=%E5%AD%A6%E7%A7%91%E5%BB%BA%E8%AE%BE' }], + [5, { title: '浙大研究生院 -- 海外交流', tag: '&tag=%E6%B5%B7%E5%A4%96%E4%BA%A4%E6%B5%81' }], +]); + +module.exports = async (ctx) => { + const type = Number.parseInt(ctx.params.type); + const tag = map.get(type).tag; + const res = await axios({ + method: 'get', + url: host + `${tag}`, + }); + + const $ = cheerio.load(res.data); + const list = $('.cg-pic-news-list') + .find('li') + .slice(0, 20); + + const items = + list && + list + .map((index, item) => { + item = $(item); + return { + title: item.find('a').text(), + pubDate: new Date(item.find('.art-dateee').text()).toUTCString(), + link: `http://grs.zju.edu.cn/${item + .find('a') + .eq(-1) + .attr('href')}`, + description: item.find('div').text(), + }; + }) + .get(); + + ctx.state.data = { + title: map.get(type).title, + link: host + `${tag}`, + item: items, + }; +}; diff --git a/lib/routes/universities/zju/physics/index.js b/lib/routes/universities/zju/physics/index.js new file mode 100644 index 0000000000..922fa59c0b --- /dev/null +++ b/lib/routes/universities/zju/physics/index.js @@ -0,0 +1,53 @@ +const axios = require('../../../../utils/axios'); +const cheerio = require('cheerio'); +const iconv = require('iconv-lite'); + +const host = 'http://physics.zju.edu.cn/redir.php?catalog_id='; + +const map = new Map([ + [1, { title: '浙大物理系 -- 本系动态', id: '66' }], + [2, { title: '浙大物理系 -- 科研通知', id: '88' }], + [3, { title: '浙大物理系 -- 研究生教育最新消息', id: '104' }], + [4, { title: '浙大物理系 -- 学生思政最新消息', id: '112' }], + [5, { title: '浙大物理系 -- 研究生思政消息公告', id: '155' }], + [6, { title: '浙大物理系 -- 研究生奖助学金', id: '661' }], + [7, { title: '浙大物理系 -- 研究生思政就业信息', id: '664' }], + [8, { title: '浙大物理系 -- 本科生思政消息公告', id: '667' }], + [9, { title: '浙大物理系 -- 本科生奖助学金', id: '670' }], + [10, { title: '浙大物理系 -- 本科生就业信息', id: '671' }], +]); + +module.exports = async (ctx) => { + const type = Number.parseInt(ctx.params.type); + const id = map.get(type).id; + const res = await axios({ + method: 'get', + url: host + `${id}`, + responseType: 'arraybuffer', + }); + + const $ = cheerio.load(iconv.decode(res.data, 'gb2312')); + const list = $('.art_list') + .find('li') + .slice(0, 20); + + const items = + list && + list + .map((index, item) => { + item = $(item); + return { + title: item.find('a').text(), + // title: item.find('a').attr('title'), + pubDate: new Date(item.find('.date').text()).toUTCString(), + link: `http://physics.zju.edu.cn/${item.find('a').attr('href')}`, + }; + }) + .get(); + + ctx.state.data = { + title: map.get(type).title, + link: host + `${id}`, + item: items, + }; +};