mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 22:19:40 +08:00
feat: 新增HNUST教务处通知 (#4296)
This commit is contained in:
@@ -490,6 +490,12 @@ category 列表:
|
||||
|
||||
</Route>
|
||||
|
||||
## 湖南科技大学
|
||||
|
||||
### 教务处通知
|
||||
|
||||
<Route author="Pretty9" example="/hnust/jwc" path="/hnust/jwc"/>
|
||||
|
||||
## 华北水利水电大学
|
||||
|
||||
### 学校通知
|
||||
|
||||
@@ -2410,6 +2410,9 @@ router.get('/hubu/news/:type', require('./routes/universities/hubu/news'));
|
||||
// 大连海事大学
|
||||
router.get('/dlmu/news/:type', require('./routes/universities/dlmu/news'));
|
||||
|
||||
// 湖南科技大学教务处
|
||||
router.get('/hnust/jwc', require('./routes/universities/hnust/jwc/index'));
|
||||
|
||||
// AGE动漫
|
||||
router.get('/agefans/detail/:id', require('./routes/agefans/detail'));
|
||||
|
||||
|
||||
33
lib/routes/universities/hnust/jwc/index.js
Normal file
33
lib/routes/universities/hnust/jwc/index.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
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 response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('.articleList ul li');
|
||||
|
||||
ctx.state.data = {
|
||||
title: '湖南科技大学教务处通知',
|
||||
link: link,
|
||||
description: '湖南科技大学教务处通知',
|
||||
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(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user