Files
RSSHub/lib/v2/2cycd/radar.js
Shelken 269e8bcdc9 feat(route): add 二次元虫洞 (#10406)
* feat(route): add 二次元虫洞

* refactor(radar): 完善二次元虫洞radar

* Apply suggestions from code review

规范代码

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* style: auto format

* fix(route): 增加时间解析

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* fix(route): 引入时间解析方法

Co-authored-by: shelken <shelken.pxk@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-07 10:19:59 -06:00

26 lines
922 B
JavaScript

module.exports = {
'2cycd.com': {
_name: '二次元虫洞',
'.': [
{
title: '板块',
docs: 'https://docs.rsshub.app/bbs.html#er-ci-yuan-chong-dong',
source: '/:path',
target: (params, url) => {
let pid, sort;
const static_matched = params.path.match(/forum-(\d+)-\d+.html/);
if (static_matched) {
pid = static_matched[1];
} else if (params.path === 'forum.php') {
pid = new URL(url).searchParams.get('fid');
sort = new URL(url).searchParams.get('orderby');
} else {
return false;
}
return `/2cycd/${pid}/${sort ? sort : 'dateline'}`;
},
},
],
},
};