Files
RSSHub/lib/v2/v2ex/radar.js
T
Lei Zhangandpull[bot] 9335585210 fix: V2EX Route Exclude Duplicate Posts (#13144)
* update: V2EX Route Exclude Duplicate Posts

* use ctx.query.limit

* refactor: migrate to v2

---------

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
2023-08-29 20:54:06 +08:00

36 lines
1.3 KiB
JavaScript

module.exports = {
'v2ex.com': {
_name: 'V2EX',
'.': [
{
title: '最热 / 最新主题',
docs: 'https://docs.rsshub.app/routes/v2ex',
source: ['/'],
target: (_, url) => {
const { searchParams } = new URL(url);
if (searchParams.get('tab') === 'all' || searchParams.get('tab') === 'hot') {
return `/v2ex/topics/${searchParams.get('tab')?.replace('all', 'latest')}`;
}
},
},
{
title: '帖子',
docs: 'https://docs.rsshub.app/routes/v2ex',
source: ['/t/:postid'],
target: '/v2ex/post/:postid',
},
{
title: '标签',
docs: 'https://docs.rsshub.app/routes/v2ex',
source: ['/'],
target: (_, url) => {
const { searchParams } = new URL(url);
if (searchParams.get('tab') && searchParams.get('tab') !== 'all' && searchParams.get('tab') !== 'hot') {
return `/v2ex/tab/${searchParams.get('tab')}`;
}
},
},
],
},
};