diff --git a/docs/university.md b/docs/university.md index 5759d242ea..7734bec77d 100644 --- a/docs/university.md +++ b/docs/university.md @@ -1729,6 +1729,10 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS +### 后勤集团 + + + ## 南京工程学院 ### 南京工程学院通知公告 diff --git a/lib/v2/nju/hqjt.js b/lib/v2/nju/hqjt.js new file mode 100644 index 0000000000..52fcf32583 --- /dev/null +++ b/lib/v2/nju/hqjt.js @@ -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]], + }; +}; diff --git a/lib/v2/nju/jjc.js b/lib/v2/nju/jjc.js index c24ac9cb44..50b421329a 100644 --- a/lib/v2/nju/jjc.js +++ b/lib/v2/nju/jjc.js @@ -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], diff --git a/lib/v2/nju/maintainer.js b/lib/v2/nju/maintainer.js index fa0d80788d..b0a0d4806a 100644 --- a/lib/v2/nju/maintainer.js +++ b/lib/v2/nju/maintainer.js @@ -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'], diff --git a/lib/v2/nju/radar.js b/lib/v2/nju/radar.js index 8a86fc65b8..fa1e1bc87a 100644 --- a/lib/v2/nju/radar.js +++ b/lib/v2/nju/radar.js @@ -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: '招标办公室', diff --git a/lib/v2/nju/router.js b/lib/v2/nju/router.js index 202e83231e..a66edda6a9 100644 --- a/lib/v2/nju/router.js +++ b/lib/v2/nju/router.js @@ -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'));