Merge branch 'master' of https://github.com/RayHY/RSSHub into RayHY-master

This commit is contained in:
DIYgod
2019-03-08 11:24:56 +08:00
4 changed files with 14 additions and 12 deletions

4
docs/README.md Normal file → Executable file
View File

@@ -1845,7 +1845,7 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet
### 华中科技大学 ### 华中科技大学
<route name="自动化学院通知" author="jinxiapu" example="/hust/auto/notice/0" path="/universities/hust/auto/notice/:type?" :paramsDesc="['分区 type, 默认为最新通知 可在网页 HTML中找到']"> <route name="人工智能和自动化学院通知" author="RayHY" example="/hust/aia/notice/0" path="/universities/hust/aia/notice/:type?" :paramsDesc="['分区 type, 默认为最新通知 可在网页 HTML中找到']">
| 最新 | 行政 | 人事 | 科研 | 讲座 | 本科生 | 研究生 | 学工 | | 最新 | 行政 | 人事 | 科研 | 讲座 | 本科生 | 研究生 | 学工 |
| ---- | ---- | ---- | ---- | ---- | ------ | ------ | ---- | | ---- | ---- | ---- | ---- | ---- | ------ | ------ | ---- |
@@ -1853,7 +1853,7 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet
</route> </route>
<route name="自动化学院新闻" author="jinxiapu" example="/hust/auto/news" path="/universities/hust/auto/news" /> <route name="人工智能和自动化学院新闻" author="RayHY" example="/hust/aia/news" path="/universities/hust/aia/news" />
### 山东大学 ### 山东大学

6
lib/router.js Normal file → Executable file
View File

@@ -669,8 +669,10 @@ router.get('/kmust/job/careers/:type?', require('./routes/universities/kmust/job
router.get('/kmust/job/jobfairs', require('./routes/universities/kmust/job/jobfairs')); router.get('/kmust/job/jobfairs', require('./routes/universities/kmust/job/jobfairs'));
// 华中科技大学 // 华中科技大学
router.get('/hust/auto/notice/:type?', require('./routes/universities/hust/auto/notice')); router.get('/hust/auto/notice/:type?', require('./routes/universities/hust/aia/notice'));
router.get('/hust/auto/news/', require('./routes/universities/hust/auto/news')); router.get('/hust/auto/news/', require('./routes/universities/hust/aia/news'));
router.get('/hust/aia/news/', require('./routes/universities/hust/aia/news'));
router.get('/hust/aia/notice/:type?', require('./routes/universities/hust/aia/notice'));
// 山东大学 // 山东大学
router.get('/sdu/grad/academic', require('./routes/universities/sdu/grad/academic')); router.get('/sdu/grad/academic', require('./routes/universities/sdu/grad/academic'));

View File

@@ -3,15 +3,15 @@ const cheerio = require('cheerio');
const url = require('url').resolve; const url = require('url').resolve;
module.exports = async (ctx) => { module.exports = async (ctx) => {
const link = 'http://auto.hust.edu.cn/yxxw.htm'; const link = 'http://aia.hust.edu.cn/yxxw.htm';
const response = await axios.get(link); const response = await axios.get(link);
const $ = cheerio.load(response.data); const $ = cheerio.load(response.data);
const list = $('.N02_list li dl').splice(0, 10); const list = $('.N02_list li dl').splice(0, 10);
ctx.state.data = { ctx.state.data = {
title: '华科自动化学院新闻', title: '华科人工智能和自动化学院新闻',
link: link, link: link,
description: '华科自动化学院新闻', description: '华科人工智能和自动化学院新闻',
item: item:
list && list &&
list list
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
const year_month = item.find('.N02_list_Icon').text(); const year_month = item.find('.N02_list_Icon').text();
return { return {
title: item.find('h4 a').text(), title: item.find('h4 a').text(),
description: item.find('dd p').text() || '华科自动化学院新闻', description: item.find('dd p').text() || '华科人工智能和自动化学院新闻',
pubDate: new Date(year_month + ' ' + day).toUTCString(), pubDate: new Date(year_month + ' ' + day).toUTCString(),
link: url(link, item.find('h4 a').attr('href')), link: url(link, item.find('h4 a').attr('href')),
}; };

View File

@@ -6,7 +6,7 @@ const typelist = ['最新', '行政', '人事', '科研', '讲座', '本科生',
module.exports = async (ctx) => { module.exports = async (ctx) => {
const type = parseInt(ctx.params.type) || 0; const type = parseInt(ctx.params.type) || 0;
const link = 'http://auto.hust.edu.cn/'; const link = 'http://aia.hust.edu.cn/';
const response = await axios.get(link); const response = await axios.get(link);
const $ = cheerio.load(response.data); const $ = cheerio.load(response.data);
const list = $('.m_content .m_con') const list = $('.m_content .m_con')
@@ -15,9 +15,9 @@ module.exports = async (ctx) => {
.splice(0, 10); .splice(0, 10);
ctx.state.data = { ctx.state.data = {
title: `华科自动化学院${typelist[type]}通知`, title: `华科人工智能和自动化学院${typelist[type]}通知`,
link: link, link: link,
description: `华科自动化学院${typelist[type]}通知`, description: `华科人工智能和自动化学院${typelist[type]}通知`,
item: item:
list && list &&
list list
@@ -30,7 +30,7 @@ module.exports = async (ctx) => {
const year_month = item.find('.N02_list_Icon').text(); const year_month = item.find('.N02_list_Icon').text();
return { return {
title: item.find('h4 a').text(), title: item.find('h4 a').text(),
description: item.find('dd p').text() || `华科自动化学院${typelist[type]}通知`, description: item.find('dd p').text() || `华科人工智能和自动化学院${typelist[type]}通知`,
pubDate: new Date(year_month + ' ' + day).toUTCString(), pubDate: new Date(year_month + ' ' + day).toUTCString(),
link: url(link, item.find('h4 a').attr('href')), link: url(link, item.find('h4 a').attr('href')),
}; };