feat(radar): leetcode radar

This commit is contained in:
Tony
2022-08-05 12:49:21 +00:00
parent 9ee9dc608b
commit 03ff28996d
6 changed files with 136 additions and 81 deletions

50
lib/v2/leetcode/radar.js Normal file
View File

@@ -0,0 +1,50 @@
module.exports = {
'leetcode.com': {
_name: 'LeetCode',
'.': [
{
title: '文章',
docs: 'https://docs.rsshub.app/programming.html#leetcode',
source: ['/articles'],
target: '/leetcode/articles',
},
{
title: '打卡',
docs: 'https://docs.rsshub.app/programming.html#leetcode',
source: ['/:user'],
target: (params) => {
if (params.user !== 'articles') {
return `/leetcode/submission/us/:user`;
}
},
},
{
title: '每日一题',
docs: 'https://docs.rsshub.app/programming.html#leetcode',
source: ['/'],
target: '/leetcode/dailyquestion/en',
},
],
},
'leetcode.cn': {
_name: 'LeetCode',
'.': [
{
title: '打卡',
docs: 'https://docs.rsshub.app/programming.html#leetcode',
source: ['/:user'],
target: (params) => {
if (params.user !== 'articles') {
return `/leetcode/submission/cn/:user`;
}
},
},
{
title: '每日一题',
docs: 'https://docs.rsshub.app/programming.html#leetcode',
source: ['/'],
target: '/leetcode/dailyquestion/cn',
},
],
},
};