feat: 新增HNUST艺术学院计算机学院研究生院 (#4317)

This commit is contained in:
Pretty9
2020-04-02 20:36:58 +08:00
committed by GitHub
parent e8598660b2
commit 72a085810d
6 changed files with 131 additions and 1 deletions

View File

@@ -496,6 +496,24 @@ category 列表:
<Route author="Pretty9" example="/hnust/jwc" path="/hnust/jwc"/> <Route author="Pretty9" example="/hnust/jwc" path="/hnust/jwc"/>
### 计算机科学与工程学院通知
<Route author="Pretty9" example="/hnust/computer" path="/hnust/computer">
### 艺术学院通知
<Route author="Pretty9" example="/hnust/art" path="/hnust/art">
### 研究生院招生工作
<Route author="Pretty9" example="/hnust/graduate/sszs" path="/hnust/graduate/:type?" :paramsDesc="['默认为 `sszs`']">
| 硕士招生 | 博士招生 |
| -------- | -------- |
| sszs | bszs |
</Route>
## 华北水利水电大学 ## 华北水利水电大学
### 学校通知 ### 学校通知

View File

@@ -2414,6 +2414,9 @@ router.get('/dlmu/news/:type', require('./routes/universities/dlmu/news'));
// 湖南科技大学教务处 // 湖南科技大学教务处
router.get('/hnust/jwc', require('./routes/universities/hnust/jwc/index')); router.get('/hnust/jwc', require('./routes/universities/hnust/jwc/index'));
router.get('/hnust/computer', require('./routes/universities/hnust/computer/index'));
router.get('/hnust/art', require('./routes/universities/hnust/art/index'));
router.get('/hnust/graduate/:type?', require('./routes/universities/hnust/graduate/index'));
// AGE动漫 // AGE动漫
router.get('/agefans/detail/:id', require('./routes/agefans/detail')); router.get('/agefans/detail/:id', require('./routes/agefans/detail'));

View File

@@ -0,0 +1,34 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const base = 'https://art.hnust.edu.cn/ggtz/';
const link = base + 'index.htm';
const response = await got.get(link);
const $ = cheerio.load(response.data);
const list = $('.newsList03 li');
ctx.state.data = {
title: '湖南科技大学艺术学院通知',
link: link,
description: '湖南科技大学艺术学院通知',
image: 'https://i.loli.net/2020/03/24/EAoPzbTsBxeOdjH.jpg',
item:
list &&
list
.map((index, item) => {
item = $(item);
const date = item.find('span').text();
const title = item.find('a').text();
const url = base + item.find('a').attr('href');
return {
title: title,
description: title,
pubDate: new Date(date).toUTCString(),
link: url,
};
})
.get(),
};
};

View File

@@ -0,0 +1,34 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const base = 'http://computer.hnust.edu.cn/tzgg/';
const link = base + 'index.htm';
const response = await got.get(link);
const $ = cheerio.load(response.data);
const list = $('.list01 li');
ctx.state.data = {
title: '湖南科技大学计算机科学与工程学院通知',
link: link,
description: '湖南科技大学计算机科学与工程学院通知',
image: 'https://i.loli.net/2020/03/24/EAoPzbTsBxeOdjH.jpg',
item:
list &&
list
.map((index, item) => {
item = $(item);
const date = item.find('span').text();
const title = item.find('a').text();
const url = base + item.find('a').attr('href');
return {
title: title,
description: title,
pubDate: new Date(date).toUTCString(),
link: url,
};
})
.get(),
};
};

View File

@@ -0,0 +1,40 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const map = {
sszs: 'sszs/',
bszs: 'bszs/',
};
module.exports = async (ctx) => {
const type = ctx.params.type || 'sszs';
const base = 'http://graduate.hnust.cn/zsgz/' + (map.hasOwnProperty(type) ? map[type] : map.sszs);
const link = `${base}index.htm`;
const response = await got.get(link);
const $ = cheerio.load(response.data);
const list = $('.item ul li').slice(4);
ctx.state.data = {
title: '湖南科技大学研究生院招生工作通知',
link: link,
description: '湖南科技大学研究生院招生工作通知',
image: 'https://i.loli.net/2020/03/24/EAoPzbTsBxeOdjH.jpg',
item:
list &&
list
.map((index, item) => {
item = $(item);
const date = item.find('span').text();
const title = item.find('a').text();
const url = base + item.find('a').attr('href');
return {
title: title,
description: title,
pubDate: new Date(date).toUTCString(),
link: url,
};
})
.get(),
};
};

View File

@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
module.exports = async (ctx) => { module.exports = async (ctx) => {
const base = 'http://jwc.hnust.edu.cn/gzzd2_20170827120536008171/jwk3_20170827120536008171/'; const base = 'http://jwc.hnust.edu.cn/gzzd2_20170827120536008171/jwk3_20170827120536008171/';
const link = 'http://jwc.hnust.edu.cn/gzzd2_20170827120536008171/jwk3_20170827120536008171/index.htm'; const link = base + 'index.htm';
const response = await got.get(link); const response = await got.get(link);
const $ = cheerio.load(response.data); const $ = cheerio.load(response.data);
const list = $('.articleList ul li'); const list = $('.articleList ul li');
@@ -12,6 +12,7 @@ module.exports = async (ctx) => {
title: '湖南科技大学教务处通知', title: '湖南科技大学教务处通知',
link: link, link: link,
description: '湖南科技大学教务处通知', description: '湖南科技大学教务处通知',
image: 'https://i.loli.net/2020/03/24/EAoPzbTsBxeOdjH.jpg',
item: item:
list && list &&
list list