mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat(route): add 南昌大学教务处 (#13973)
* 添加了新的RSSHub路由,支持Radar ,以及修改了对应的文档 新增了针对南昌大学教务处通知的RSSHub路由,支持Radar。 同时修改了RSShub文档 * Removed redundant settings and fixed the year. 删去了多余的代码,更正了正确的年份
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
const got = require('@/utils/got'); // 自订的 got
|
||||
const cheerio = require('cheerio'); // 可以使用类似 jQuery 的 API HTML 解析器
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const baseUrl = "https://jwc.ncu.edu.cn";
|
||||
const response = await got(baseUrl);
|
||||
const $ = cheerio.load(response.body);
|
||||
|
||||
const list = $(".box3 .inner ul.img-list li");
|
||||
|
||||
ctx.state.data = {
|
||||
title: "南昌大学教务处",
|
||||
link: baseUrl,
|
||||
description: "南昌大学教务处",
|
||||
item:
|
||||
list &&
|
||||
list.toArray().map((item) => {
|
||||
const el = $(item);
|
||||
const linkEl = el.find("a");
|
||||
const date = el.text().split("】")[0].replace("【", "").trim();
|
||||
const title = linkEl.attr("title");
|
||||
const link = `${baseUrl}/${linkEl.attr("href")}`;
|
||||
const month = date.slice(0, 2);
|
||||
|
||||
return {
|
||||
title,
|
||||
link,
|
||||
pubDate: parseDate(date, 'MM-DD').setFullYear(month < 6 ? new Date().getFullYear() - 1 : new Date().getFullYear()),
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/jwc': ['ywh555hhh'],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
'ncu.edu.cn': {
|
||||
_name: '南昌大学',
|
||||
'.': [
|
||||
{
|
||||
title: '教务通知',
|
||||
docs: 'https://docs.rsshub.app/routes/university#nan-chang-da-xue',
|
||||
source: ['/', '/jwtz/index.htm'],
|
||||
target: '/ncu/jwc',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/jwc', require('./jwc'));
|
||||
|
||||
};
|
||||
@@ -2108,6 +2108,12 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
|
||||
|
||||
</Route>
|
||||
|
||||
## 南昌大学 {#nan-chang-da-xue}
|
||||
|
||||
### 教务通知 {#nan-chang-da-xue--jiao-wu-tong-zhi}
|
||||
|
||||
<Route author="ywh555hhh" example="/ncu/jwc" path="/ncu/jwc" radar="1" />
|
||||
|
||||
## 南昌航空大学 {#nan-chang-hang-kong-da-xue}
|
||||
|
||||
### 教务处公告与新闻 {#nan-chang-hang-kong-da-xue-jiao-wu-chu-gong-gao-yu-xin-wen}
|
||||
|
||||
Reference in New Issue
Block a user