diff --git a/lib/v2/cas/genetics/xshd.js b/lib/v2/cas/genetics/xshd.js new file mode 100644 index 0000000000..6e4bbd836f --- /dev/null +++ b/lib/v2/cas/genetics/xshd.js @@ -0,0 +1,29 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const baseUrl = 'https://genetics.cas.cn/jixs/yg/'; + + const { data: response } = await got(baseUrl); + const $ = cheerio.load(response); + + const items = $('li.row.no-gutters.py-1') + .toArray() + .map((item) => { + item = $(item); + const a = item.find('a').first(); + const date = item.find('.col-news-date').first(); + return { + title: a.text(), + link: new URL(a.attr('href'), baseUrl).href, + pubDate: parseDate(date.text(), 'YYYY.MM.DD'), + }; + }); + + ctx.state.data = { + title: 'IGDB - 学术活动', + link: baseUrl, + item: items, + }; +}; diff --git a/lib/v2/cas/maintainer.js b/lib/v2/cas/maintainer.js index 04d0e7d923..0025b232fc 100644 --- a/lib/v2/cas/maintainer.js +++ b/lib/v2/cas/maintainer.js @@ -1,5 +1,6 @@ module.exports = { '/cg/:caty?': ['nczitzk'], + '/genetics/xshd': ['panyq357'], '/ia/yjs': ['shengmaosu'], '/iee/kydt': ['nczitzk'], '/is/:path+': ['Misaka13514'], diff --git a/lib/v2/cas/radar.js b/lib/v2/cas/radar.js index f5c58e880e..10f812784f 100644 --- a/lib/v2/cas/radar.js +++ b/lib/v2/cas/radar.js @@ -9,6 +9,14 @@ module.exports = { target: '/cas/cg/:caty?', }, ], + 'www.genetics': [ + { + title: '遗传与生物学研究所 - 学术活动', + docs: 'https://docs.rsshub.app/university.html#zhong-guo-ke-xue-yuan', + source: ['/jixs/yg', '/'], + target: '/cas/genetics/xshd', + }, + ], 'www.ia': [ { title: '自动化所', @@ -17,6 +25,14 @@ module.exports = { target: '/cas/ia/yjs', }, ], + 'www.iee': [ + { + title: '电工研究所 科研动态', + docs: 'https://docs.rsshub.app/routes/university#zhong-guo-ke-xue-yuan', + source: ['/xwzx/kydt', '/'], + target: '/cas/iee/kydt', + }, + ], 'www.is': [ { title: '软件研究所', @@ -37,14 +53,6 @@ module.exports = { target: '/cas/sim/kyjz', }, ], - 'www.iee': [ - { - title: '电工研究所 科研动态', - docs: 'https://docs.rsshub.app/routes/university#zhong-guo-ke-xue-yuan', - source: ['/xwzx/kydt', '/'], - target: '/cas/iee/kydt', - }, - ], }, 'mesalab.cn': { _name: '中国科学院', diff --git a/lib/v2/cas/router.js b/lib/v2/cas/router.js index fe4e5f49c1..2ac205ea34 100644 --- a/lib/v2/cas/router.js +++ b/lib/v2/cas/router.js @@ -1,5 +1,6 @@ module.exports = (router) => { router.get('/cg/:caty?', require('./cg/index')); + router.get('/genetics/xshd', require('./genetics/xshd')); router.get('/ia/yjs', require('./ia/yjs')); router.get('/iee/kydt', require('./iee/kydt')); router.get('/is/:path+', require('./is/index')); diff --git a/website/docs/routes/university.md b/website/docs/routes/university.md index 528b1b1f4f..818d6deb8f 100644 --- a/website/docs/routes/university.md +++ b/website/docs/routes/university.md @@ -3842,6 +3842,10 @@ paramsDesc={['公告类型,详见表格']}> +### 遗传与发育生物学研究所 学术活动 {#zhong-guo-ke-xue-yuan-yi-chuan-yu-fa-yu-sheng-wu-xue-yan-jiu-suo-xue-shu-huo-dong} + + + ## 中国科学院大学 {#zhong-guo-ke-xue-yuan-da-xue} ### 招聘信息 {#zhong-guo-ke-xue-yuan-da-xue-zhao-pin-xin-xi}