diff --git a/docs/en/study.md b/docs/en/study.md index 82b05fd62..589148f79 100644 --- a/docs/en/study.md +++ b/docs/en/study.md @@ -4,6 +4,20 @@ pageClass: routes # Study +## Asian Innovation and Entrepreneurship Association + +### Seminar Series + + + +| Time frame | +| ----- | +| upcoming | +| past | +| both| + + + ## gradCafe ### gradCafe result diff --git a/docs/study.md b/docs/study.md index 4c565f9c8..ae233e10a 100644 --- a/docs/study.md +++ b/docs/study.md @@ -37,12 +37,26 @@ pageClass: routes | bilingual | 双语新闻 (Bilingual News) | | address | 总统演讲 (President Address) | +## Asian Innovation and Entrepreneurship Association + +### Seminar Series + + + +| 时间段 | +| -------- | +| upcoming | +| past | +| both | + + + ## CTFHub Calendar ### 查询国内外 CTF 赛事信息 - | `:class` | 类型 | @@ -65,8 +79,8 @@ path="/ctfhub/search/:limit?/:form?/:class?/:title?" ### 查询近期赛事 - diff --git a/lib/v2/aiea/index.js b/lib/v2/aiea/index.js new file mode 100644 index 000000000..a807a39ff --- /dev/null +++ b/lib/v2/aiea/index.js @@ -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()`, + }, + }); +}; diff --git a/lib/v2/aiea/maintainer.js b/lib/v2/aiea/maintainer.js new file mode 100644 index 000000000..75e1cf78e --- /dev/null +++ b/lib/v2/aiea/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/seminars/:period': ['zxx-457'], +}; diff --git a/lib/v2/aiea/radar.js b/lib/v2/aiea/radar.js new file mode 100644 index 000000000..2dcbbd05d --- /dev/null +++ b/lib/v2/aiea/radar.js @@ -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', + }, + ], + }, +}; diff --git a/lib/v2/aiea/router.js b/lib/v2/aiea/router.js new file mode 100644 index 000000000..129d36967 --- /dev/null +++ b/lib/v2/aiea/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + return router.get('/seminars/:period', require('.')); +};