feat(route): add 南京大学后勤集团 (#10334)

* feat(route): add 南京大学基建处/本科迎新

* feat(route): add 南京大学基建处/本科迎新

* fix: sort router

* feat(route): add 南京大学后勤集团

* refactor: sort rardar
This commit is contained in:
XR-Y
2022-07-28 22:54:49 +08:00
committed by GitHub
parent 77cd9df1d4
commit e6f9689859
6 changed files with 55 additions and 2 deletions
+4
View File
@@ -1729,6 +1729,10 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
<Route author="ret-1" example="/nju/admission" path="/nju/admission" />
### 后勤集团
<Route author="ret-1" example="/nju/hqjt" path="/nju/hqjt" />
## 南京工程学院
### 南京工程学院通知公告
+39
View File
@@ -0,0 +1,39 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
const timezone = require('@/utils/timezone');
module.exports = async (ctx) => {
const category_dict = {
zbcg: '招标采购',
};
const items = await Promise.all(
Object.keys(category_dict).map(async () => {
const response = await got(`https://webplus.nju.edu.cn/_s25/zbcg/list.psp`);
const data = response.data;
const $ = cheerio.load(data);
const list = $('li.news');
// only read first page
return Promise.resolve(
list.map((index, item) => {
item = $(item);
return {
title: item.find('a').attr('title'),
link: 'https://webplus.nju.edu.cn' + item.find('a').attr('href'),
pubDate: timezone(parseDate(item.find('span').last().text(), 'YYYY-MM-DD'), +8),
category: category_dict[0],
};
})
);
})
);
ctx.state.data = {
title: '后勤集团-招标采购',
link: 'https://webplus.nju.edu.cn/_s25/zbcg/list.psp',
item: [...items[0]],
};
};
+1 -1
View File
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
item = $(item);
return {
title: item.find('a').attr('title'),
description: item.find('a').first().text(),
description: item.find('a').attr('title'),
link: 'https://jjc.nju.edu.cn' + item.find('a').attr('href'),
pubDate: timezone(parseDate(item.find('td').last().text(), 'YYYY-MM-DD'), +8),
category: category_dict[c],
+1
View File
@@ -1,6 +1,7 @@
module.exports = {
'/admission': ['ret-1'],
'/gra': ['ret-1'],
'/hqjt': ['ret-1'],
'/jjc': ['ret-1'],
'/jw/:type': ['ret-1'],
'/rczp/:type': ['ret-1'],
+8
View File
@@ -49,6 +49,14 @@ module.exports = {
target: '/nju/scit/:type',
},
],
webplus: [
{
title: '后勤集团',
docs: 'https://docs.rsshub.app/university.html#nan-jing-da-xue-hou-qin-ji-tuan',
source: ['/_s25/main.psp'],
target: '/nju/hqjt',
},
],
zbb: [
{
title: '招标办公室',
+2 -1
View File
@@ -1,8 +1,9 @@
module.exports = function (router) {
router.get('/admission', require('./admission'));
router.get('/gra', require('./gra'));
router.get('/hqjt', require('./hqjt'));
router.get('/jjc', require('./jjc'));
router.get('/jw/:type', require('./jw'));
router.get('/gra', require('./gra'));
router.get('/rczp/:type', require('./rczp'));
router.get('/scit/:type', require('./scit'));
router.get('/zbb/:type', require('./zbb'));