fix(route): 修复中国传媒大学研究生招生网 (#10767)

* 修复中国传媒大学研究生招生网

* fix(route):修复中国传媒大学研究生招生网

* fix(route): 修复中国传媒大学研究生招生网

Co-authored-by: 牛鑫语 <niuxinyu@szbit.cn>
This commit is contained in:
niuyi 2022-09-13 12:49:17 +08:00 committed by GitHub
parent 73d103b34e
commit 06d1d824e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 6 deletions

View File

@ -3229,7 +3229,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
### 中国传媒大学研究生招生网
<Route author="YunYouJun" example="/cuc/yz" path="/cuc/yz" />
<Route author="YunYouJun niuyi1017" example="/cuc/yz" path="/cuc/yz" />
## 中国地质大学 (武汉)

View File

@ -597,7 +597,7 @@ router.get('/cas/iee/kydt', lazyloadRouteHandler('./routes/universities/cas/iee/
router.get('/cas/cg/:caty?', lazyloadRouteHandler('./routes/universities/cas/cg/index'));
// 中国传媒大学
router.get('/cuc/yz', lazyloadRouteHandler('./routes/universities/cuc/yz'));
// router.get('/cuc/yz', lazyloadRouteHandler('./v2/cuc/yz'));
// UTdallas ISSO
router.get('/utdallas/isso', lazyloadRouteHandler('./routes/universities/utdallas/isso'));

3
lib/v2/cuc/maintainer.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
'/yz': ['niuyi1017'],
};

13
lib/v2/cuc/radar.js Normal file
View File

@ -0,0 +1,13 @@
module.exports = {
'cuc.edu.cn': {
_name: '中国传媒大学',
yz: [
{
title: '研究生招生网',
docs: 'https://docs.rsshub.app/university.html#zhong-guo-chuan-mei-da-xue',
source: '/*',
target: '/',
},
],
},
};

3
lib/v2/cuc/router.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = function (router) {
router.get('/yz', require('./yz'));
};

View File

@ -1,6 +1,5 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const url = require('url');
const iconv = require('iconv-lite');
const host = 'http://yz.cuc.edu.cn/';
@ -18,13 +17,12 @@ module.exports = async (ctx) => {
const $ = cheerio.load(responseHtml);
const notice = $('#notice_area').children('.notice_block_top');
const content = notice.children('.notice_content1').children();
const content = notice.children('.notice_content1').children('p');
const items = content
.map((_, elem) => {
const a = $('a', elem);
return {
link: url.resolve(host, a.attr('href')),
link: new URL(a.attr('href'), host).href,
title: a.text(),
};
})