[DevToBridge] Allow subsribe to username (#3218)

This commit is contained in:
Sébastien MB 2023-01-30 11:59:46 +01:00 committed by GitHub
parent 69290c8e55
commit 51952c1db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -3,6 +3,7 @@
class DevToBridge extends BridgeAbstract
{
const CONTEXT_BY_TAG = 'By tag';
const CONTEXT_BY_USER = 'By user';
const NAME = 'dev.to Bridge';
const URI = 'https://dev.to';
@ -25,6 +26,21 @@ class DevToBridge extends BridgeAbstract
'required' => false,
'title' => 'Enable to receive the full article for each item'
]
],
self::CONTEXT_BY_USER => [
'user' => [
'name' => 'User',
'type' => 'text',
'required' => true,
'title' => 'Insert your username',
'exampleValue' => 'n3wt0n'
],
'full' => [
'name' => 'Full article',
'type' => 'checkbox',
'required' => false,
'title' => 'Enable to receive the full article for each item'
]
]
];
@ -36,6 +52,11 @@ class DevToBridge extends BridgeAbstract
return static::URI . '/t/' . urlencode($tag);
}
break;
case self::CONTEXT_BY_USER:
if ($user = $this->getInput('user')) {
return static::URI . '/' . urlencode($user);
}
break;
}
return parent::getURI();