forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(route): nga 匿名帖子获取失败 (DIYgod#10695)
* fix * add new domain * list format * fix
- Loading branch information
Showing
2 changed files
with
36 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,39 @@ | ||
const rules = [ | ||
{ | ||
title: '分区帖子', | ||
docs: 'https://docs.rsshub.app/bbs.html#nga-fen-qu-tie-zi', | ||
source: '/thread.php', | ||
target: (params, url) => new URL(url).searchParams.get('fid') && `/nga/forum/${new URL(url).searchParams.get('fid')}`, | ||
}, | ||
{ | ||
title: '帖子', | ||
docs: 'https://docs.rsshub.app/bbs.html#nga-tie-zi', | ||
source: '/read.php', | ||
target: (params, url) => new URL(url).searchParams.get('tid') && `/nga/post/${new URL(url).searchParams.get('tid')}`, | ||
}, | ||
{ | ||
title: '帖子 - 只看作者', | ||
docs: 'https://docs.rsshub.app/bbs.html#nga-tie-zi', | ||
source: '/read.php', | ||
target: (params, url, document) => { | ||
const tid = new URL(url).searchParams.get('tid'); | ||
const authorId = document.documentElement.innerHTML.match(/commonui\.userInfo\.setAll\(\s{3}{"(\d+)"/)[1]; | ||
return `/nga/post/${tid}/${authorId}`; | ||
}, | ||
}, | ||
]; | ||
|
||
module.exports = { | ||
'nga.cn': { | ||
_name: 'NGA', | ||
bbs: [ | ||
{ | ||
title: '分区帖子', | ||
docs: 'https://docs.rsshub.app/bbs.html#nga-fen-qu-tie-zi', | ||
source: '/thread.php', | ||
target: (params, url) => new URL(url).searchParams.get('fid') && `/nga/forum/${new URL(url).searchParams.get('fid')}`, | ||
}, | ||
{ | ||
title: '帖子', | ||
docs: 'https://docs.rsshub.app/bbs.html#nga-tie-zi', | ||
source: '/read.php', | ||
target: (params, url) => new URL(url).searchParams.get('tid') && `/nga/post/${new URL(url).searchParams.get('tid')}`, | ||
}, | ||
{ | ||
title: '帖子 - 只看作者', | ||
docs: 'https://docs.rsshub.app/bbs.html#nga-tie-zi', | ||
source: '/read.php', | ||
target: (params, url, document) => { | ||
const tid = new URL(url).searchParams.get('tid'); | ||
const authorId = document.documentElement.innerHTML.match(/commonui\.userInfo\.setAll\(\s{3}{"(\d+)"/)[1]; | ||
return `/nga/post/${tid}/${authorId}`; | ||
}, | ||
}, | ||
], | ||
bbs: rules, | ||
}, | ||
'178.com': { | ||
_name: 'NGA', | ||
nga: [ | ||
{ | ||
title: '分区帖子', | ||
docs: 'https://docs.rsshub.app/bbs.html#nga-fen-qu-tie-zi', | ||
source: '/thread.php', | ||
target: (params, url) => new URL(url).searchParams.get('fid') && `/nga/forum/${new URL(url).searchParams.get('fid')}`, | ||
}, | ||
{ | ||
title: '帖子', | ||
docs: 'https://docs.rsshub.app/bbs.html#nga-tie-zi', | ||
source: '/read.php', | ||
target: (params, url) => new URL(url).searchParams.get('tid') && `/nga/post/${new URL(url).searchParams.get('tid')}`, | ||
}, | ||
{ | ||
title: '帖子 - 只看作者', | ||
docs: 'https://docs.rsshub.app/bbs.html#nga-tie-zi', | ||
source: '/read.php', | ||
target: (params, url, document) => { | ||
const tid = new URL(url).searchParams.get('tid'); | ||
const authorId = document.documentElement.innerHTML.match(/commonui\.userInfo\.setAll\(\s{3}{"(\d+)"/)[1]; | ||
return `/nga/post/${tid}/${authorId}`; | ||
}, | ||
}, | ||
], | ||
nga: rules, | ||
}, | ||
'ngabbs.com': { | ||
_name: 'NGA', | ||
'.': rules, | ||
}, | ||
}; |