feat: 南京艺术学院研究生院 (#10528)

* 南京艺术学院研究生院

* Update lib/v2/nua/gra.js

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update lib/v2/nua/gra.js

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update lib/v2/nua/gra.js

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update lib/v2/nua/radar.js

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update lib/v2/nua/radar.js

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update lib/v2/nua/gra.js

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update lib/v2/nua/gra.js

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update docs/university.md

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update docs/university.md
This commit is contained in:
evnydd0sf
2022-08-18 21:41:02 +08:00
committed by GitHub
co-authored by Tony
parent 78ccdc7848
commit 3bae792736
5 changed files with 90 additions and 0 deletions
+15
View File
@@ -2073,6 +2073,21 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
</Route>
## 南京艺术学院
### 研究生处
<Route author="evnydd0sf" example="/nua/gra/1959" path="/nua/gra/:type" :paramsDesc="['种类名,见下表']" radar="1">
| 种类名 | 参数 |
| ----- | ---- |
| 招生工作 | 1959 |
| 培养工作 | 1962 |
| 学位工作 | 1958 |
| 思政与管理 | 1960 |
</Route>
## 清华大学
### 清华大学校内信息发布平台
+56
View File
@@ -0,0 +1,56 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
const timezone = require('@/utils/timezone');
const baseUrl = 'https://grad.nua.edu.cn';
module.exports = async (ctx) => {
const type = ctx.params.type;
const newsUrl = `${baseUrl}/${type}/list.htm`;
const response = await got(newsUrl, {
https: {
rejectUnauthorized: false,
},
});
const data = response.data;
const $ = cheerio.load(data);
const pagename = $('.col_title').text();
const items = $('li.list_item')
.toArray()
.map((item) => {
item = $(item);
return {
link: baseUrl + item.find('a').attr('href'),
title: item.find('a').attr('title'),
pubDate: timezone(parseDate(item.find('.Article_PublishDate').first().text(), 'YYYY-MM-DD'), +8),
};
});
const results = await Promise.all(
items.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const result = await got(item.link, {
https: {
rejectUnauthorized: false,
},
});
const $ = cheerio.load(result.data);
item.author = $('.arti_publisher').text();
item.description = $('.read').html();
return item;
})
)
);
ctx.state.data = {
title: 'NUA-研究生处-' + pagename,
link: `${baseUrl}/${type}/list.htm`,
description: '南京艺术学院研究生处' + pagename,
item: results,
};
};
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
'/gra/:type': ['evnydd0sf'],
};
+13
View File
@@ -0,0 +1,13 @@
module.exports = {
'nua.edu.cn': {
_name: '南京艺术学院',
grad: [
{
title: '研究生处',
docs: 'https://docs.rsshub.app/university.html#nan-jing-yi-shu-xue-yuan',
source: ['/:type/list.htm'],
target: '/nua/gra/:type',
},
],
},
};
+3
View File
@@ -0,0 +1,3 @@
module.exports = function (router) {
router.get('/gra/:type', require('./gra'));
};