mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[GiphyBridge] include bundle parameter in api calls to reduce bandwidth (#2627)
This commit is contained in:
parent
c498749c2b
commit
7833d0e6c3
@ -62,9 +62,10 @@ HTML
|
|||||||
* but it has severe rate limiting.
|
* but it has severe rate limiting.
|
||||||
*
|
*
|
||||||
* https://giphy.api-docs.io/1.0/welcome/access-and-api-keys
|
* https://giphy.api-docs.io/1.0/welcome/access-and-api-keys
|
||||||
* https://giphy.api-docs.io/1.0/gifs/search-1
|
* https://developers.giphy.com/branch/master/docs/api/endpoint/#search
|
||||||
*/
|
*/
|
||||||
$apiKey = 'Gc7131jiJuvI7IdN0HZ1D7nh0ow5BU6g';
|
$apiKey = 'Gc7131jiJuvI7IdN0HZ1D7nh0ow5BU6g';
|
||||||
|
$bundle = 'low_bandwidth';
|
||||||
$limit = min($this->getInput('n') ?: 10, 50);
|
$limit = min($this->getInput('n') ?: 10, 50);
|
||||||
$endpoints = array();
|
$endpoints = array();
|
||||||
if (empty($this->getInput('noGif'))) {
|
if (empty($this->getInput('noGif'))) {
|
||||||
@ -76,10 +77,11 @@ HTML
|
|||||||
|
|
||||||
foreach ($endpoints as $endpoint) {
|
foreach ($endpoints as $endpoint) {
|
||||||
$uri = sprintf(
|
$uri = sprintf(
|
||||||
'https://api.giphy.com/v1/%s/search?q=%s&limit=%s&api_key=%s',
|
'https://api.giphy.com/v1/%s/search?q=%s&limit=%s&bundle=%s&api_key=%s',
|
||||||
$endpoint,
|
$endpoint,
|
||||||
rawurlencode($this->getInput('s')),
|
rawurlencode($this->getInput('s')),
|
||||||
$limit,
|
$limit,
|
||||||
|
$bundle,
|
||||||
$apiKey
|
$apiKey
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user