mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 18:14:44 +02:00
bridges: add context to detectParameters (#3607)
* bridges: add context to detectParameters Some bridges did not return the context parameter but they used it in the parameters * bridges: add context to detectParameters Fix test for InstagramBridge
This commit is contained in:
parent
6cc4cf24dc
commit
52d3cce59d
13 changed files with 115 additions and 80 deletions
|
@ -603,6 +603,7 @@ class FurAffinityBridge extends BridgeAbstract
|
|||
// Single journal
|
||||
$regex = '/^(https?:\/\/)?(www\.)?furaffinity.net\/journal\/(\d+)/';
|
||||
if (preg_match($regex, $url, $matches) > 0) {
|
||||
$params['context'] = 'Single Journal';
|
||||
$params['journal-id'] = urldecode($matches[3]);
|
||||
return $params;
|
||||
}
|
||||
|
@ -610,6 +611,7 @@ class FurAffinityBridge extends BridgeAbstract
|
|||
// Journals
|
||||
$regex = '/^(https?:\/\/)?(www\.)?furaffinity.net\/journals\/([^\/&?\n]+)/';
|
||||
if (preg_match($regex, $url, $matches) > 0) {
|
||||
$params['context'] = 'Journals';
|
||||
$params['username-journals'] = urldecode($matches[3]);
|
||||
return $params;
|
||||
}
|
||||
|
@ -617,6 +619,7 @@ class FurAffinityBridge extends BridgeAbstract
|
|||
// Gallery folder
|
||||
$regex = '/^(https?:\/\/)?(www\.)?furaffinity.net\/gallery\/([^\/&?\n]+)\/folder\/(\d+)/';
|
||||
if (preg_match($regex, $url, $matches) > 0) {
|
||||
$params['context'] = 'Gallery Folder';
|
||||
$params['username-folder'] = urldecode($matches[3]);
|
||||
$params['folder-id'] = urldecode($matches[4]);
|
||||
$params['full'] = 'on';
|
||||
|
@ -626,6 +629,7 @@ class FurAffinityBridge extends BridgeAbstract
|
|||
// Gallery (must be after gallery folder)
|
||||
$regex = '/^(https?:\/\/)?(www\.)?furaffinity.net\/(gallery|scraps|favorites)\/([^\/&?\n]+)/';
|
||||
if (preg_match($regex, $url, $matches) > 0) {
|
||||
$params['context'] = 'Gallery';
|
||||
$params['username-' . $matches[3]] = urldecode($matches[4]);
|
||||
$params['full'] = 'on';
|
||||
return $params;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue