diff --git a/docs/university.md b/docs/university.md
index 04b71bf0e..eba308673 100644
--- a/docs/university.md
+++ b/docs/university.md
@@ -2059,11 +2059,49 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
## 南京艺术学院
+### 官网信息
+
+
+
+| 新闻模块 | 参数 |
+| ---- | --- |
+| 公告 | 346 |
+| 南艺要闻 | 332 |
+
+
+
+### 双馨网
+
+
+
+| 新闻模块 | 参数 |
+| ---- | --- |
+| 校园电视 | 230 |
+| 院部动态 | 232 |
+| 动感校园 | 233 |
+| 招就指南 | 234 |
+| 南艺院报 | 236 |
+
+
+
+### 设计学院
+
+
+
+| 新闻模块 | 参数 |
+| ---------- | ------- |
+| 学院新闻 NEWS | news |
+| 教学 TEACH | teach |
+| 项目 PROJECT | project |
+| 党团 PARTY | party |
+
+
+
### 研究生处
-
+
-| 种类名 | 参数 |
+| 新闻模块 | 参数 |
| ----- | ---- |
| 招生工作 | 1959 |
| 培养工作 | 1962 |
diff --git a/lib/v2/nua/dc.js b/lib/v2/nua/dc.js
new file mode 100644
index 000000000..a5e9d8af1
--- /dev/null
+++ b/lib/v2/nua/dc.js
@@ -0,0 +1,53 @@
+// const got = require('@/utils/got');
+// const cheerio = require('cheerio');
+const util = require('./utils');
+
+module.exports = async (ctx) => {
+ const type = ctx.params.type;
+
+ const baseUrl = 'https://dc.nua.edu.cn';
+
+ let listName;
+ let listDate;
+ let artiContent;
+ let webPageName;
+
+ switch (type) {
+ case 'news':
+ listName = 'li.pre35.left li.news_list';
+ listDate = '.date';
+ artiContent = '.article';
+ webPageName = 'li.pre35.left .big_title';
+ break;
+ case 'teach':
+ listName = 'li.pre65.right li.effects';
+ listDate = '.date';
+ artiContent = '.article';
+ webPageName = 'li.pre65.right .big_title';
+ break;
+ case 'project':
+ listName = 'ul.center div.center_list_img';
+ listDate = '.date';
+ artiContent = '.article';
+ webPageName = 'ul.center .big_title';
+ break;
+ case 'party':
+ listName = 'div.pre35.right li.party_list';
+ listDate = '.date';
+ artiContent = '.article';
+ webPageName = 'div.pre35.right .big_title';
+ break;
+ default:
+ throw Error(`暂不支持对${type}的订阅`);
+ }
+
+ const items = await util.ProcessList(baseUrl, baseUrl, listName, listDate, webPageName);
+ const results = await util.ProcessFeed(items[0], artiContent, ctx.cache);
+
+ ctx.state.data = {
+ title: 'NUA-设计学院-' + items[1],
+ link: baseUrl,
+ description: '南京艺术学院 设计学院 ' + items[1],
+ item: results,
+ };
+};
diff --git a/lib/v2/nua/gra.js b/lib/v2/nua/gra.js
index be538fb3b..4a80156e8 100644
--- a/lib/v2/nua/gra.js
+++ b/lib/v2/nua/gra.js
@@ -1,56 +1,21 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-const { parseDate } = require('@/utils/parse-date');
-const timezone = require('@/utils/timezone');
+const util = require('./utils');
const baseUrl = 'https://grad.nua.edu.cn';
module.exports = async (ctx) => {
const type = ctx.params.type;
const newsUrl = `${baseUrl}/${type}/list.htm`;
+ const listName = 'li.list_item';
+ const artiContent = '.read';
+ const listDate = '.Article_PublishDate';
+ const webPageName = '.col_title';
- 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;
- })
- )
- );
+ const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate, webPageName);
+ const results = await util.ProcessFeed(items[0], artiContent, ctx.cache);
ctx.state.data = {
- title: 'NUA-研究生处-' + pagename,
+ title: 'NUA-研究生处-' + items[1],
link: `${baseUrl}/${type}/list.htm`,
- description: '南京艺术学院研究生处' + pagename,
+ description: '南京艺术学院 研究生处 ' + items[1],
item: results,
};
};
diff --git a/lib/v2/nua/index.js b/lib/v2/nua/index.js
new file mode 100644
index 000000000..a50b52481
--- /dev/null
+++ b/lib/v2/nua/index.js
@@ -0,0 +1,22 @@
+const util = require('./utils');
+
+module.exports = async (ctx) => {
+ const type = ctx.params.type;
+
+ const baseUrl = 'https://www.nua.edu.cn';
+ const newsUrl = `${baseUrl}/${type}/list.htm`;
+ const listName = 'li.news';
+ const listDate = '.news_meta';
+ const webPageName = '.col_title';
+
+ const artiContent = '.read';
+ const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate, webPageName);
+ const results = await util.ProcessFeed(items[0], artiContent, ctx.cache);
+
+ ctx.state.data = {
+ title: 'NUA-' + items[1],
+ link: newsUrl,
+ description: '南京艺术学院 ' + items[1],
+ item: results,
+ };
+};
diff --git a/lib/v2/nua/maintainer.js b/lib/v2/nua/maintainer.js
index 187c84ed1..6d4282961 100644
--- a/lib/v2/nua/maintainer.js
+++ b/lib/v2/nua/maintainer.js
@@ -1,3 +1,6 @@
module.exports = {
+ '/dc/:type': ['evnydd0sf'],
'/gra/:type': ['evnydd0sf'],
+ '/index/:type': ['evnydd0sf'],
+ '/sxw/:type': ['evnydd0sf'],
};
diff --git a/lib/v2/nua/radar.js b/lib/v2/nua/radar.js
index a7e471ef0..9052e31d1 100644
--- a/lib/v2/nua/radar.js
+++ b/lib/v2/nua/radar.js
@@ -1,6 +1,30 @@
module.exports = {
'nua.edu.cn': {
_name: '南京艺术学院',
+ index: [
+ {
+ title: '官网信息',
+ docs: 'https://docs.rsshub.app/university.html#nan-jing-yi-shu-xue-yuan',
+ source: ['/:type/list.htm'],
+ target: '/nua/index/:type',
+ },
+ ],
+ sxw: [
+ {
+ title: '双馨网',
+ docs: 'https://docs.rsshub.app/university.html#nan-jing-yi-shu-xue-yuan',
+ source: ['/:type/list.htm'],
+ target: '/nua/sxw/:type',
+ },
+ ],
+ dc: [
+ {
+ title: '设计学院',
+ docs: 'https://docs.rsshub.app/university.html#nan-jing-yi-shu-xue-yuan',
+ source: ['/:type/list.htm'],
+ target: '/nua/dc/:type',
+ },
+ ],
grad: [
{
title: '研究生处',
diff --git a/lib/v2/nua/router.js b/lib/v2/nua/router.js
index 0157a1edb..c7ac0eec4 100644
--- a/lib/v2/nua/router.js
+++ b/lib/v2/nua/router.js
@@ -1,3 +1,6 @@
module.exports = function (router) {
+ router.get('/dc/:type', require('./dc'));
router.get('/gra/:type', require('./gra'));
+ router.get('/index/:type', require('./index'));
+ router.get('/sxw/:type', require('./sxw'));
};
diff --git a/lib/v2/nua/sxw.js b/lib/v2/nua/sxw.js
new file mode 100644
index 000000000..dc2d45490
--- /dev/null
+++ b/lib/v2/nua/sxw.js
@@ -0,0 +1,22 @@
+const util = require('./utils');
+
+module.exports = async (ctx) => {
+ const type = ctx.params.type;
+
+ const baseUrl = 'https://sxw.nua.edu.cn';
+ const newsUrl = `${baseUrl}/${type}/list.htm`;
+ const listName = 'li.list_item';
+ const listDate = '.Article_PublishDate';
+ const webPageName = '.Column_Anchor';
+
+ const artiContent = '.read';
+ const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate, webPageName);
+ const results = await util.ProcessFeed(items[0], artiContent, ctx.cache);
+
+ ctx.state.data = {
+ title: 'NUA-双馨网-' + items[1],
+ link: newsUrl,
+ description: '南京艺术学院 双馨网 ' + items[1],
+ item: results,
+ };
+};
diff --git a/lib/v2/nua/utils.js b/lib/v2/nua/utils.js
new file mode 100644
index 000000000..ee3fb34b4
--- /dev/null
+++ b/lib/v2/nua/utils.js
@@ -0,0 +1,60 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const timezone = require('@/utils/timezone');
+
+async function ProcessList(newsUrl, baseUrl, listName, listDate, webPageName) {
+ const result = await got(newsUrl, {
+ https: {
+ rejectUnauthorized: false,
+ },
+ });
+ const $ = cheerio.load(result.data);
+
+ const pageName = $(webPageName).text();
+
+ let artiLink;
+
+ const items = $(listName)
+ .toArray()
+ .map((item) => {
+ item = $(item);
+ if (item.find('a').attr('href').includes('http')) {
+ artiLink = item.find('a').attr('href');
+ } else {
+ artiLink = baseUrl + item.find('a').attr('href');
+ }
+
+ return {
+ link: artiLink,
+ title: item.find('a').attr('title'),
+ pubDate: timezone(parseDate(item.find(listDate).first().text(), 'YYYY-MM-DD'), +8),
+ };
+ });
+
+ return [items, pageName];
+}
+
+const ProcessFeed = async (items, artiContent, cache) =>
+ await Promise.all(
+ items.map((item) =>
+ cache.tryGet(item.link, async () => {
+ const result = await got(item.link, {
+ https: {
+ rejectUnauthorized: false,
+ },
+ });
+ const $ = cheerio.load(result.data);
+
+ item.author = $('.arti_publisher').text() + ' ' + $('.arti_views').text();
+ item.description = $(artiContent).html();
+
+ return item;
+ })
+ )
+ );
+
+module.exports = {
+ ProcessList,
+ ProcessFeed,
+};