From 7833d0e6c3e965727e3179ae02b7fed4df509f97 Mon Sep 17 00:00:00 2001 From: User123698745 Date: Sun, 10 Apr 2022 15:21:43 +0200 Subject: [PATCH] [GiphyBridge] include bundle parameter in api calls to reduce bandwidth (#2627) --- bridges/GiphyBridge.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bridges/GiphyBridge.php b/bridges/GiphyBridge.php index 38cfcb8f..326ce638 100644 --- a/bridges/GiphyBridge.php +++ b/bridges/GiphyBridge.php @@ -62,9 +62,10 @@ HTML * 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/gifs/search-1 + * https://developers.giphy.com/branch/master/docs/api/endpoint/#search */ $apiKey = 'Gc7131jiJuvI7IdN0HZ1D7nh0ow5BU6g'; + $bundle = 'low_bandwidth'; $limit = min($this->getInput('n') ?: 10, 50); $endpoints = array(); if (empty($this->getInput('noGif'))) { @@ -76,10 +77,11 @@ HTML foreach ($endpoints as $endpoint) { $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, rawurlencode($this->getInput('s')), $limit, + $bundle, $apiKey );