feat(route): add AtCoder (#8825)

This commit is contained in:
Ethan Shen
2022-01-23 04:05:10 +08:00
committed by GitHub
parent 548136c56a
commit d95705b4db
7 changed files with 220 additions and 0 deletions

22
lib/v2/atcoder/radar.js Normal file
View File

@@ -0,0 +1,22 @@
module.exports = {
'atcoder.jp': {
_name: 'AtCoder',
'.': [
{
title: 'Posts',
docs: 'https://docs.rsshub.app/programming.html#atcoder-posts',
source: ['/posts', '/'],
target: (params, url) => `/atcoder/post/${new URL(url).searchParams.get('lang') ?? 'en'}/${new URL(url).searchParams.get('keyword') ?? ''}`,
},
{
title: 'Contests',
docs: 'https://docs.rsshub.app/programming.html#atcoder-contests',
source: ['/contests/archive', '/contests', ''],
target: (params, url) =>
`/atcoder/content/${new URL(url).searchParams.get('lang') ?? 'en'}/${new URL(url).searchParams.get('ratedType') ?? '0'}/${new URL(url).searchParams.get('category') ?? '0'}/${
new URL(url).searchParams.get('keyword') ?? ''
}`,
},
],
},
};