feat(route): add AIEA seminars (#11302)

* feat(route): add AIEA seminars

* Fix lib/v2/aiea/radar.js

* fix lib/v2/aiea/maintainer.js

* add docs

* add docs title

* fix comma

* docs: add en docs
This commit is contained in:
zxx-457 2022-11-22 02:47:16 +08:00 committed by GitHub
parent 10cf5a2468
commit 52c887a2cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 90 additions and 4 deletions

View File

@ -4,6 +4,20 @@ pageClass: routes
# Study
## Asian Innovation and Entrepreneurship Association
### Seminar Series
<RouteEn author="zxx-457" example="/aiea/seminars/upcoming" path="/aiea/seminars/:period" :paramsDesc="['Time frame']">
| Time frame |
| ----- |
| upcoming |
| past |
| both|
</RouteEn>
## gradCafe
### gradCafe result

View File

@ -37,12 +37,26 @@ pageClass: routes
| bilingual | 双语新闻 (Bilingual News) |
| address | 总统演讲 (President Address) |
## Asian Innovation and Entrepreneurship Association
### Seminar Series
<Route author="zxx-457" example="/aiea/seminars/upcoming" path="/aiea/seminars/:period" :paramsDesc="['时间段']">
| 时间段 |
| -------- |
| upcoming |
| past |
| both |
</Route>
## CTFHub Calendar
### 查询国内外 CTF 赛事信息
<Route author="frankli0324" example="/ctfhub/search"
path="/ctfhub/search/:limit?/:form?/:class?/:title?"
<Route author="frankli0324" example="/ctfhub/search"
path="/ctfhub/search/:limit?/:form?/:class?/:title?"
:paramsDesc="['一个整数筛选最新的limit场比赛默认为10', '比赛形式', '比赛类型', '通过CTF赛事名称过滤']">
| `:class` | 类型 |
@ -65,8 +79,8 @@ path="/ctfhub/search/:limit?/:form?/:class?/:title?"
### 查询近期赛事
<Route author="frankli0324" example="/ctfhub/upcoming"
path="/ctfhub/upcoming/:limit?"
<Route author="frankli0324" example="/ctfhub/upcoming"
path="/ctfhub/upcoming/:limit?"
:paramsDesc="['一个整数筛选最近的limit场比赛默认为5']">
</Route>

39
lib/v2/aiea/index.js Normal file
View File

@ -0,0 +1,39 @@
const buildData = require('@/utils/common-config');
module.exports = async (ctx) => {
const link = 'http://www.aiea.org/0504';
const period = ctx.params.period ?? '';
let nth_child = 'n';
switch (period) {
case 'upcoming':
nth_child = '1';
break;
case 'past':
nth_child = '2';
break;
case 'both':
nth_child = 'n';
break;
default:
break;
}
ctx.state.data = await buildData({
link,
url: link,
title: `%title%`,
params: {
title: 'AIEA Seminars',
},
item: {
item: `.seminar-contents .seminar-partWrap:nth-child(${nth_child}) > .seminar-list`,
title: `$('.seminar-list-title > span').text()`,
link: `$('a[href^="/0504"]').attr('href')`,
description: `$('.seminar-list .txt > .title').text()`,
},
});
};

View File

@ -0,0 +1,3 @@
module.exports = {
'/seminars/:period': ['zxx-457'],
};

13
lib/v2/aiea/radar.js Normal file
View File

@ -0,0 +1,13 @@
module.exports = {
'aiea.org': {
_name: 'Asian Innovation and Entrepreneurship Association',
www: [
{
title: 'Seminar Series',
docs: 'https://docs.rsshub.app/study.html#AIEA-Seminar-Series',
source: ['/0504', '/'],
target: '/aiea/seminars/upcoming',
},
],
},
};

3
lib/v2/aiea/router.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = function (router) {
return router.get('/seminars/:period', require('.'));
};