diff --git a/docs/university.md b/docs/university.md index 11d5e8cff..04b71bf0e 100644 --- a/docs/university.md +++ b/docs/university.md @@ -1811,7 +1811,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 教务处 - + | 通知公告 | 教学服务 | 教学建设 | 学生培养 | 教学资源 | | ---- | ---- | ---- | ---- | ---- | @@ -1821,7 +1821,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 研究生院 - + | 通知公告 | 新闻动态 | 学术信息 | 师生风采 | | ---- | ---- | ---- | ---- | @@ -1831,7 +1831,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 自动化学院 - + | 综合新闻 | 党委行政 | 人事 / 合作 | 研究生培养 | 本科生培养 | 学生工作 | 通知公告 | 学术信息 | 答辩公告 | | ---- | ---- | ------- | ----- | ----- | ---- | ---- | ---- | ---- | @@ -1839,7 +1839,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 计算机科学与技术学院 - + | 通知公告 | 热点新闻 | 学科科研 | 教学动态 | 本科生培养 | 研究生培养 | 学生工作 | | ---- | ---- | ---- | ---- | ----- | ----- | ---- | diff --git a/lib/v2/nuaa/college/cae.js b/lib/v2/nuaa/college/cae.js index c2f2a8822..3f2dfa6c0 100644 --- a/lib/v2/nuaa/college/cae.js +++ b/lib/v2/nuaa/college/cae.js @@ -43,36 +43,30 @@ module.exports = async (ctx) => { .get(); const out = await Promise.all( - list.map((info) => { - const title = info.title || 'zhxw'; + list.map(async (info) => { + const title = info.title || 'tzgg'; const date = info.date; const itemUrl = new URL(info.link, host).href; + let description = title + '
查看原文'; - return ctx.cache.tryGet(itemUrl, async () => { - const arr = itemUrl.split('.'); - const pageType = arr[arr.length - 1]; - - // 南航新 WAF 过于敏感 - // 目前 description 需要遍历页面,会被 WAF 拦截导致无法输出 - // 考虑换一种获取 description 的方式或者将标题当作 title。 - let description = title + '
查看原文'; - if (getDescription) { - description = itemUrl; + if (getDescription) { + description = await ctx.cache.tryGet(itemUrl, async () => { + const arr = itemUrl.split('.'); + const pageType = arr[arr.length - 1]; if (pageType === 'htm' || pageType === 'html') { const response = await got(itemUrl, gotConfig); const $ = cheerio.load(response.data); - description = $('.wp_articlecontent').html() + '

查看原文'; + return $('.wp_articlecontent').html() + '

查看原文'; } - } + }); + } - const single = { - title, - link: itemUrl, - description, - pubDate: parseDate(date), - }; - return single; - }); + return { + title, + link: itemUrl, + description, + pubDate: parseDate(date), + }; }) ); diff --git a/lib/v2/nuaa/college/cs.js b/lib/v2/nuaa/college/cs.js index 36eae3327..672573432 100644 --- a/lib/v2/nuaa/college/cs.js +++ b/lib/v2/nuaa/college/cs.js @@ -42,39 +42,30 @@ module.exports = async (ctx) => { .get(); const out = await Promise.all( - list.map((info) => { + list.map(async (info) => { const title = info.title || 'tzgg'; const date = info.date; const itemUrl = new URL(info.link, host).href; + let description = title + '
查看原文'; - return ctx.cache.tryGet(itemUrl, async () => { - const arr = itemUrl.split('.'); - const pageType = arr[arr.length - 1]; - - // 南航新 WAF 过于敏感 - // 目前 description 需要遍历页面,会被 WAF 拦截导致无法输出 - // 考虑换一种获取 description 的方式或者将标题当作 title。 - let description = title; - if (getDescription) { - description = itemUrl; + if (getDescription) { + description = await ctx.cache.tryGet(itemUrl, async () => { + const arr = itemUrl.split('.'); + const pageType = arr[arr.length - 1]; if (pageType === 'htm' || pageType === 'html') { - const response = await got.get(itemUrl, gotConfig); + const response = await got(itemUrl, gotConfig); const $ = cheerio.load(response.data); - description = $('.wp_articlecontent') - .html() - .replace(/src="\//g, `src="${new URL('.', host).href}`) - .trim(); + return $('.wp_articlecontent').html() + '

查看原文'; } - } + }); + } - const single = { - title, - link: itemUrl, - description, - pubDate: parseDate(date), - }; - return single; - }); + return { + title, + link: itemUrl, + description, + pubDate: parseDate(date), + }; }) ); diff --git a/lib/v2/nuaa/jwc/jwc.js b/lib/v2/nuaa/jwc/jwc.js index 3710b759f..22c8b2229 100644 --- a/lib/v2/nuaa/jwc/jwc.js +++ b/lib/v2/nuaa/jwc/jwc.js @@ -40,36 +40,30 @@ module.exports = async (ctx) => { .get(); const out = await Promise.all( - list.map((info) => { + list.map(async (info) => { const title = info.title || 'tzgg'; const date = info.date; const itemUrl = new URL(info.link, host).href; + let description = title + '
查看原文'; - return ctx.cache.tryGet(itemUrl, async () => { - const arr = itemUrl.split('.'); - const pageType = arr[arr.length - 1]; - - // 南航新 WAF 过于敏感 - // 目前 description 需要遍历页面,会被 WAF 拦截导致无法输出 - // 考虑换一种获取 description 的方式或者将标题当作 title。 - let description = title + '
查看原文'; - if (getDescription) { - description = itemUrl; + if (getDescription) { + description = await ctx.cache.tryGet(itemUrl, async () => { + const arr = itemUrl.split('.'); + const pageType = arr[arr.length - 1]; if (pageType === 'htm' || pageType === 'html') { const response = await got(itemUrl, gotConfig); const $ = cheerio.load(response.data); - description = $('.wp_articlecontent').html() + '

查看原文'; + return $('.wp_articlecontent').html() + '

查看原文'; } - } + }); + } - const single = { - title, - link: itemUrl, - description, - pubDate: parseDate(date), - }; - return single; - }); + return { + title, + link: itemUrl, + description, + pubDate: parseDate(date), + }; }) ); diff --git a/lib/v2/nuaa/maintainer.js b/lib/v2/nuaa/maintainer.js index 12dfe3d76..bd7b7fc5e 100644 --- a/lib/v2/nuaa/maintainer.js +++ b/lib/v2/nuaa/maintainer.js @@ -1,6 +1,6 @@ module.exports = { - '/cae/:type/:getDescription?': ['Seiry', 'qrzbing', 'Xm798'], - '/cs/:type/:getDescription?': ['LogicJake', 'Seiry', 'qrzbing'], + '/cae/:type/:getDescription?': ['Xm798'], + '/cs/:type/:getDescription?': ['LogicJake', 'Seiry', 'qrzbing', 'Xm798'], '/jwc/:type/:getDescription?': ['arcosx', 'Seiry', 'qrzbing', 'Xm798'], '/yjsy/:type/:getDescription?': ['junfengP', 'Seiry', 'Xm798'], }; diff --git a/lib/v2/nuaa/yjsy/yjsy.js b/lib/v2/nuaa/yjsy/yjsy.js index fb8d25ace..c36bb1c29 100644 --- a/lib/v2/nuaa/yjsy/yjsy.js +++ b/lib/v2/nuaa/yjsy/yjsy.js @@ -38,36 +38,30 @@ module.exports = async (ctx) => { .get(); const out = await Promise.all( - list.map((info) => { + list.map(async (info) => { const title = info.title || 'tzgg'; const date = info.date; const itemUrl = new URL(info.link, host).href; + let description = title + '
查看原文'; - return ctx.cache.tryGet(itemUrl, async () => { - const arr = itemUrl.split('.'); - const pageType = arr[arr.length - 1]; - - // 南航新 WAF 过于敏感 - // 目前 description 需要遍历页面,会被 WAF 拦截导致无法输出 - // 考虑换一种获取 description 的方式或者将标题当作 title。 - let description = title + '
查看原文'; - if (getDescription) { - description = itemUrl; + if (getDescription) { + description = await ctx.cache.tryGet(itemUrl, async () => { + const arr = itemUrl.split('.'); + const pageType = arr[arr.length - 1]; if (pageType === 'htm' || pageType === 'html') { const response = await got(itemUrl, gotConfig); const $ = cheerio.load(response.data); - description = $('.wp_articlecontent').html() + '

查看原文'; + return $('.wp_articlecontent').html() + '

查看原文'; } - } + }); + } - const single = { - title, - link: itemUrl, - description, - pubDate: parseDate(date), - }; - return single; - }); + return { + title, + link: itemUrl, + description, + pubDate: parseDate(date), + }; }) );