From 9a2e1b42f8bf3368893f4278d415beb0e523f612 Mon Sep 17 00:00:00 2001 From: Jeason Lau Date: Tue, 24 Mar 2020 11:23:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=9C=E5=8C=97=E5=A4=A7=E5=AD=A6?= =?UTF-8?q?=E6=96=B0=E9=97=BB=E7=BD=91rss=20(#4273)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/university.md | 6 +++--- lib/routes/universities/neu/news.js | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/university.md b/docs/university.md index 6178d0780..827740d4c 100644 --- a/docs/university.md +++ b/docs/university.md @@ -265,9 +265,9 @@ xskb1 对应 http://www.auto.uestc.edu.cn/index/xskb1.htm -| 东大要闻 | 媒体东大 | 通知公告 | 新闻纵横 | 人才培养 | 学术科研 | 英文新闻 | 招生就业 | 考研出国 | 校园文学 | 校友风采 | -| -------- | -------- | -------- | -------- | -------: | -------- | -------- | -------- | -------- | -------- | -------- | -| ddyw | mtdd | tzgg | xwzh | rcpy | xsky | 217 | zsjy | kycg | xywx | xyfc | +| 东大要闻 | 媒体东大 | 通知公告 | 新闻纵横 | 人才培养 | 学术科研 | 英文新闻 | 招生就业 | 考研出国 | 校园文学 | 校友风采 | 时事热点 | 教育前沿 | 文化体育 | 最新科技 | +| -------- | -------- | -------- | -------- | -------: | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| ddyw | mtdd | tzgg | xwzh | rcpy | xsky | 217 | zsjy | kycg | xywx | xyfc | ssrd | jyqy | whty | zxkj | diff --git a/lib/routes/universities/neu/news.js b/lib/routes/universities/neu/news.js index c2645d92e..a95cd5ee8 100644 --- a/lib/routes/universities/neu/news.js +++ b/lib/routes/universities/neu/news.js @@ -1,7 +1,7 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); -const baseUrl = 'http://neunews.neu.edu.cn'; +const baseUrl = 'https://neunews.neu.edu.cn'; module.exports = async (ctx) => { const type = ctx.params.type; const newsUrl = `${baseUrl}/${type}/list.htm`; @@ -15,7 +15,7 @@ module.exports = async (ctx) => { const title = $('title').text(); const items = $('.column-news-list > .news_list > .news > .news_title') - .slice(0, 10) + .slice(0, 5) .get(); const results = await Promise.all( items.map(async (item) => { @@ -54,11 +54,12 @@ module.exports = async (ctx) => { description: description, link: url, }; - Promise.resolve(result); + return Promise.resolve(result); }) ); ctx.state.data = { title: `东北大学新闻网-${title}`, + link: newsUrl, item: results, }; };