mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-10 07:12:51 +08:00
feat: 添加北大生科院近期讲座 (#3685)
This commit is contained in:
@@ -759,7 +759,7 @@
|
||||
title: '分类',
|
||||
docs: 'https://docs.rsshub.app/new-media.html#hao-qi-xin-ri-bao',
|
||||
source: '/categories/:idd',
|
||||
target: (params) => `/qdaily/researcach/${params.idd.replace('.html', '')}`,
|
||||
target: (params) => `/qdaily/category/${params.idd.replace('.html', '')}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -411,9 +411,9 @@ Supported sub-sites:
|
||||
|
||||
<Route author="WenhuWee emdoe SivaGao HenryQW" example="/qdaily/column/59" path="/qdaily/:type/:id" :paramsDesc="['类型,见下表', '对应 id,可在 URL 找到']" radar="1">
|
||||
|
||||
| 标签 | 栏目 | 分类 |
|
||||
| ---- | ------ | ---------- |
|
||||
| tag | column | researcach |
|
||||
| 标签 | 栏目 | 分类 |
|
||||
| ---- | ------ | -------- |
|
||||
| tag | column | category |
|
||||
|
||||
</Route>
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ pageClass: routes
|
||||
|
||||
<Route author="AngUOI" example="/pku/rccp/mzyt" path="/universities/pku/rccp/mzyt" />
|
||||
|
||||
### 生命科学学院近期讲座
|
||||
|
||||
<Route author="TPOB" example="/pku/cls/lecture" path="/universities/pku/cls/lecture" />
|
||||
|
||||
## 北京航空航天大学
|
||||
|
||||
### 北京航空航天大学
|
||||
|
||||
@@ -581,6 +581,7 @@ router.get('/lit/tw/:name?', require('./routes/universities/lit/tw'));
|
||||
// 北京大学
|
||||
router.get('/pku/eecs/:type?', require('./routes/universities/pku/eecs'));
|
||||
router.get('/pku/rccp/mzyt', require('./routes/universities/pku/rccp/mzyt'));
|
||||
router.get('/pku/cls/lecture', require('./routes/universities/pku/cls/lecture'));
|
||||
|
||||
// 上海海事大学
|
||||
router.get('/shmtu/www/:type', require('./routes/universities/shmtu/www'));
|
||||
|
||||
30
lib/routes/universities/pku/cls/lecture.js
Normal file
30
lib/routes/universities/pku/cls/lecture.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
const homeUrl = 'http://www.bio.pku.edu.cn/homes/Index/news_jz/7/7.html';
|
||||
const baseUrl = 'http://www.bio.pku.edu.cn';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: homeUrl,
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
ctx.state.data = {
|
||||
title: `北京大学生命科学学院近期讲座`,
|
||||
link: homeUrl,
|
||||
description: `北京大学生命科学学院近期讲座`,
|
||||
item: $('a.clearfix')
|
||||
.map((index, item) => ({
|
||||
title: $(item)
|
||||
.find('p')
|
||||
.text()
|
||||
.trim(),
|
||||
description: '日期: ' + $(item).find('span'), // ${item.find('.chair_txt div').find('span').second().text()}
|
||||
|
||||
link: baseUrl + $('a.clearfix').attr('href'),
|
||||
}))
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user