diff --git a/docs/university.md b/docs/university.md index 8d6e888c38..480b390780 100644 --- a/docs/university.md +++ b/docs/university.md @@ -619,7 +619,7 @@ pageClass: routes | 博士研究生 | 硕士研究生 | 同等学力攻读硕士学位 | 港澳台地区招生 | | :--------: | :--------: | :------------------: | :------------: | -| bsyjs | ssyjs | tdxlgdssxw | gatdqzs | +| bsyjs | ssyjs | tdxlgdssxw | gatdqzs | @@ -1049,6 +1049,10 @@ pageClass: routes +### 学术信息 + + + ## 东南大学 ### 信息科学与工程学院学术活动 @@ -1257,7 +1261,7 @@ category 列表: | 通知公告 | 新闻动态 | 学籍注册 | 奖助学金 | 其他 | | :------: | :------: | :------: | :------: | :--: | -| 2981 | 2980 | 3009 | 3011 | ... | +| 2981 | 2980 | 3009 | 3011 | ... | @@ -1289,7 +1293,7 @@ category 列表: | 新闻 | 新闻 - 要闻 | 新闻 - 专题策划 | 其他 | | :------: | :---------: | :-------------: | :--: | -| /card/xw | /list/xw/yw | /card/xw/ztch | ... | +| /card/xw | /list/xw/yw | /card/xw/ztch | ... | @@ -1299,7 +1303,7 @@ category 列表: | 新闻动态 | 通知公告 | 其他 | | :------: | :------: | :--: | -| 3751 | 3752 | ... | +| 3751 | 3752 | ... | @@ -2376,7 +2380,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS | 通知公告 | 本科生教务 | 研究生教务 | | :------: | :--------: | :--------: | -| tzgg | bksjw | yjsjw | +| tzgg | bksjw | yjsjw | @@ -2836,7 +2840,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS | 聚焦天大 | 综合新闻 | 校内新闻 | 媒体报道 | 图说天大 | | :------: | :------: | :------: | :------: | :------: | -| focus | general | internal | media | picture | +| focus | general | internal | media | picture | @@ -2846,7 +2850,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS | 学部新闻 | 通知公告 | 北洋智算论坛 | | :------: | :----------: | :----------: | -| news | notification | forum | +| news | notification | forum | @@ -2866,7 +2870,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS | 校级公告 | 统考硕士 | 统考博士 | 在职学位 | | :------: | :------: | :------: | :------: | -| notice | master | doctor | job | +| notice | master | doctor | job | @@ -2914,7 +2918,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS | 温大新闻 | 媒体温大 | 学术温大 | 通知公告 | 招标信息 | 学术公告 | | :------: | :------: | :------: | :------: | :------: | :------: | -| 0 | 1 | 2 | 3 | 4 | 5 | +| 0 | 1 | 2 | 3 | 4 | 5 | @@ -3761,7 +3765,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS | 招聘类型 | 博士后 | 课题项目聘用 | 管理支撑人才 | 教学科研人才 | | :------: | :----: | :----------: | :----------: | :----------: | -| 参数 | bsh | ktxmpy | glzcrc | jxkyrc | +| 参数 | bsh | ktxmpy | glzcrc | jxkyrc | diff --git a/lib/v2/dhu/maintainer.js b/lib/v2/dhu/maintainer.js index 28fd3315c6..b754aef4e9 100644 --- a/lib/v2/dhu/maintainer.js +++ b/lib/v2/dhu/maintainer.js @@ -1,5 +1,6 @@ module.exports = { '/jiaowu/news/:type?': ['KiraKiseki'], + '/news/xsxx': ['fox2049'], '/xxgk/news': ['KiraKiseki'], '/yjs/zs/:type?': ['fox2049'], }; diff --git a/lib/v2/dhu/news/xsxx.js b/lib/v2/dhu/news/xsxx.js new file mode 100644 index 0000000000..90a773e83d --- /dev/null +++ b/lib/v2/dhu/news/xsxx.js @@ -0,0 +1,42 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +const baseUrl = 'https://news.dhu.edu.cn/_wp3services/generalQuery?queryObj=articles&siteId=14&columnId=6410&pageIndex=1&rows=20'; + +module.exports = async (ctx) => { + const { data } = await got(baseUrl, { + headers: { + Referer: 'https://news.dhu.edu.cn/6410/', + }, + }); + // 从 API 响应中提取相关数据 + const list = data.data.map((item) => ({ + // 文章标题 + title: item.title, + // 文章链接 + link: item.wapUrl, + // 文章发布日期 + pubDate: parseDate(item.publishTime), + // 文章作者 + author: item.publisher, + })); + + // item content + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const { data: response } = await got(item.link); + const $ = cheerio.load(response); + item.description = $('.new_zwCot').first().html(); + return item; + }) + ) + ); + + ctx.state.data = { + title: '学术信息', + link: 'https://news.dhu.edu.cn/6410', + item: items, + }; +}; diff --git a/lib/v2/dhu/radar.js b/lib/v2/dhu/radar.js index e91e94183e..a07a40b430 100644 --- a/lib/v2/dhu/radar.js +++ b/lib/v2/dhu/radar.js @@ -7,6 +7,14 @@ module.exports = { docs: 'https://docs.rsshub.app/university.html#dong-hua-da-xue', }, ], + news: [ + { + title: '学术信息', + docs: 'https://docs.rsshub.app/university.html#dong-hua-da-xue', + source: ['/6410'], + target: '/dhu/news/xsxx', + }, + ], xxgk: [ { title: '最新信息公开', diff --git a/lib/v2/dhu/router.js b/lib/v2/dhu/router.js index 2f13d9e858..1bf575a242 100644 --- a/lib/v2/dhu/router.js +++ b/lib/v2/dhu/router.js @@ -1,5 +1,6 @@ module.exports = function (router) { router.get('/jiaowu/news/:type?', require('./jiaowu/news')); + router.get('/news/xsxx', require('./news/xsxx')); router.get('/xxgk/news', require('./xxgk/news')); router.get('/yjs/zs/:type?', require('./yjs/zs')); };