mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 23:57:29 +02:00
[KemonoBridge] Add search query support (#4620)
This commit is contained in:
@@ -24,6 +24,11 @@ class KemonoBridge extends BridgeAbstract
|
|||||||
'name' => 'User ID/Name',
|
'name' => 'User ID/Name',
|
||||||
'exampleValue' => '9069743', # Thomas Joy
|
'exampleValue' => '9069743', # Thomas Joy
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
],
|
||||||
|
'q' => [
|
||||||
|
'name' => 'Search query',
|
||||||
|
'exampleValue' => 'classic',
|
||||||
|
'required' => false,
|
||||||
]
|
]
|
||||||
]];
|
]];
|
||||||
|
|
||||||
@@ -33,13 +38,17 @@ class KemonoBridge extends BridgeAbstract
|
|||||||
{
|
{
|
||||||
$api = parent::getURI() . 'api/v1/';
|
$api = parent::getURI() . 'api/v1/';
|
||||||
$url = $api . $this->getInput('service') . '/user/' . $this->getInput('user');
|
$url = $api . $this->getInput('service') . '/user/' . $this->getInput('user');
|
||||||
|
|
||||||
|
$api_response = getContents($url . '/profile');
|
||||||
|
$profile = Json::decode($api_response);
|
||||||
|
$this->title = ucfirst($profile['name']);
|
||||||
|
|
||||||
|
if ($this->getInput('q')) {
|
||||||
|
$url .= '?q=' . urlencode($this->getInput('q'));
|
||||||
|
}
|
||||||
$api_response = getContents($url);
|
$api_response = getContents($url);
|
||||||
$json = Json::decode($api_response);
|
$json = Json::decode($api_response);
|
||||||
|
|
||||||
$url .= '/profile';
|
|
||||||
$api_response = getContents($url);
|
|
||||||
$profile = Json::decode($api_response);
|
|
||||||
$this->title = ucfirst($profile['name']);
|
|
||||||
|
|
||||||
foreach ($json as $element) {
|
foreach ($json as $element) {
|
||||||
$item = [];
|
$item = [];
|
||||||
|
Reference in New Issue
Block a user