mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 14:07:54 +08:00
feat(route): add 温州大学新闻 (#7952)
Co-authored-by: NeverBehave <gayhub@never.pet>
This commit is contained in:
@@ -1841,6 +1841,12 @@ type 列表:
|
||||
|
||||
</Route>
|
||||
|
||||
## 温州大学
|
||||
|
||||
### 新闻
|
||||
|
||||
<Route author="Chandler-Lu" example="/wzu/news" path="/wzu/news" />
|
||||
|
||||
## 温州商学院
|
||||
|
||||
### 温州商学院
|
||||
|
||||
@@ -4169,6 +4169,9 @@ router.get('/tanchinese/:category?', require('./routes/tanchinese'));
|
||||
// Harvard
|
||||
router.get('/harvard/health/blog', require('./routes/universities/harvard/health/blog'));
|
||||
|
||||
// 温州大学
|
||||
router.get('/wzu/news', require('./routes/universities/wzu/news'));
|
||||
|
||||
// Resources - The Partnership on AI
|
||||
router.get('/partnershiponai/resources', require('./routes/partnershiponai/resources'));
|
||||
|
||||
|
||||
25
lib/routes/universities/wzu/news.js
Normal file
25
lib/routes/universities/wzu/news.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const link = 'http://www.wzu.edu.cn/index/wdxw.htm';
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('#News-sidebar-b-nav').find('li');
|
||||
|
||||
ctx.state.data = {
|
||||
title: '温大新闻',
|
||||
link: link,
|
||||
description: '温州大学',
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
const a1 = item.find('li a');
|
||||
return { title: a1.attr('title'), description: a1.attr('title'), pubDate: parseDate(item.find('li samp').text(), 'YYYY-MM-DD'), link: a1.attr('href') };
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user