Create the GA callback url, aka the gif

@return string
343306
public function createGif()
    {
        $data = array();
        foreach ($this->data as $key => $item) {
            if ($item !== null) {
                $data[$key] = $item;
            }
        }
        return $this->tracking = self::GA_URL . '?' . http_build_query($data);
    }
17909
public function callback()
    {
        $code = $_GET['code'] ?? null;
        $data = [
            'appid' => $this->app_id,
            'secret' => $this->app_secret,
            'code' => $code,
            'grant_type' => 'authorization_code',
        ];
        $url = self::ACCESS_TOKEN_URL.http_build_query($data);
        $data = json_decode($this->curl->get($url));

        if (property_exists($data, 'errcode')) {
            return (array) $data;
        }

        $access_token = $data->access_token;
        $expires_in = $data->expires_in;
        $refresh_token = $data->refresh_token;
        $open_id = $data->openid;
        $scope = $data->scope;

        if ('snsapi_base' === $scope) {
            return (array) $data;
        }
        $data = $this->getUserInfo($access_token, $open_id);

        return Response::json($data);
    }
1315950
public function createUrl() {
    $string_data = $this->dataToString();
    $data_to_send = array(
      'hash' => $this->doHash($string_data),
    );
    // Adicionalmente adjuntamos el resto de los valores iniciados en $data
    foreach ($this->data as $name => $value) {
      $data_to_send[$name] = $value;
    }
    $data_to_send['agent'] = $this->agent;

    // Iniciamos CURL
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $this->apiUrl);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, TRUE);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_to_send);

    $output = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    if ($info['http_code'] == 200) {
      return $output;
    }
    else {
      return FALSE;
    }
  }
83546
protected function generateCallback($url = [])
    {
        if (empty($url)) {
            $url = $this->authChoice->createClientUrl($this->client);
        } else {
            $url = Url::to($url);
        }
        if (strpos($url, '?') === false) {
            $url .= '?';
        } else {
            $url .= '&';
        }

        $callbackName = 'googleSignInCallback' . md5($this->id);
        $js = <<<JS
function $callbackName(authResult) {
    var urlParams = [];

    if (authResult['code']) {
        urlParams.push('code=' + encodeURIComponent(authResult['code']));
    } else if (authResult['error']) {
        if (authResult['error'] == 'immediate_failed') {
            return;
        }
        urlParams.push('error=' + encodeURIComponent(authResult['error']));
        urlParams.push('error_description=' + encodeURIComponent(authResult['error_description']));
    } else {
        for (var propName in authResult) {
            var propValue = authResult[propName];
            if (typeof propValue != 'object') {
                urlParams.push(encodeURIComponent(propName) + '=' + encodeURIComponent(propValue));
            }
        }
    }

    window.location = '$url' + urlParams.join('&');
}
JS;
        $this->view->registerJs($js, View::POS_END, __CLASS__ . '#' . $this->id);

        return $callbackName;
    }
653991
public function callback() {

        $token = required_param('oauth_token', PARAM_RAW);
        $verifier = required_param('oauth_verifier', PARAM_RAW);
        $secret = $this->flickr->get_request_token_secret(['caller' => 'repository_flickr']);

        // Exchange the request token for the access token.
        $accesstoken = $this->flickr->get_access_token($token, $secret, $verifier);

        // Store the access token and the access token secret in the user preferences.
        set_user_preference('repository_flickr_access_token', $accesstoken['oauth_token']);
        set_user_preference('repository_flickr_access_token_secret', $accesstoken['oauth_token_secret']);
    }
814080
protected function _createInteractive() {
        Garp_Cli::lineOut('Please provide the following values');
        $data = array(
            'identifier' => Garp_Cli::prompt('Identifier')
        );
        if ($snippet = $this->_fetchExisting($data['identifier'])) {
            Garp_Cli::lineOut('Snippet already exists. Id: #' . $snippet->id, Garp_Cli::GREEN);
            return true;
        }

        $data['uri'] = Garp_Cli::prompt('Url');
        $checks = array(
            array('has_name', 'Does this snippet have a name?', 'y'),
            array('has_html', 'Does this snippet contain HTML?', 'y'),
            array('has_text', 'Does this snippet contain text?', 'n'),
            array('has_image', 'Does this snippet have an image?', 'n'),
        );
        foreach ($checks as $check) {
            $key = $check[0];
            $question = $check[1];
            $default = $check[2];
            if ($default == 'y') {
                $question .= ' Yn';
            } elseif ($default == 'n') {
                $question .= ' yN';
            }
            $userResponse = trim(Garp_Cli::prompt($question));
            if (!$userResponse) {
                $userResponse = $default;
            }
            if (strtolower($userResponse) == 'y' || $userResponse == 1) {
                $data[$key] = 1;
            } elseif (strtolower($userResponse) == 'n' || $userResponse == 0) {
                $data[$key] = 0;
            }
        }

        $snippet = $this->_create($data);
        Garp_Cli::lineOut(
            'New snippet inserted. Id: #' . $snippet->id . ', Identifier: "' .
            $snippet->identifier . '"'
        );
        return true;
    }
735309
public function url()
    {
        $args = func_get_args();
        $controller = array_shift($args);

        $url = $this->urlBuilder->createUrl($controller, $args);

        if ($url === false) {
            return $controller;
        } else {
            return $url;
        }
    }
427336
protected function _getUrlToRedirectBackTo()
    {
        $urlToRedirectBackTo = $this->request->getRequestTarget();
        if (!$this->request->is('get')) {
            $urlToRedirectBackTo = $this->request->referer(true);
        }

        return $urlToRedirectBackTo;
    }
91312
public function get_thumb_url($image_url, $orig_width, $orig_height, $thumb_width = 75, $force = false) {
        global $OUTPUT;

        if (!$force && $orig_width <= $thumb_width && $orig_height <= $thumb_width) {
            return $image_url;
        } else {
            $thumb_url = '';
            $commons_main_dir = 'https://upload.wikimedia.org/wikipedia/commons/';
            if ($image_url) {
                $short_path = str_replace($commons_main_dir, '', $image_url);
                $extension = strtolower(pathinfo($short_path, PATHINFO_EXTENSION));
                if (strcmp($extension, 'gif') == 0) {  //no thumb for gifs
                    return $OUTPUT->image_url(file_extension_icon('.gif', $thumb_width))->out(false);
                }
                $dir_parts = explode('/', $short_path);
                $file_name = end($dir_parts);
                if ($orig_height > $orig_width) {
                    $thumb_width = round($thumb_width * $orig_width/$orig_height);
                }
                $thumb_url = $commons_main_dir . 'thumb/' . implode('/', $dir_parts) . '/'. $thumb_width .'px-' . $file_name;
                if (strcmp($extension, 'svg') == 0) {  //png thumb for svg-s
                    $thumb_url .= '.png';
                }
            }
            return $thumb_url;
        }
    }
1362835
public function toGIF()
    {
        $this->extension = 'gif';
        $this->type = IMAGETYPE_GIF;
        $this->mimetype = Utils::getMimetypeByImageType(IMAGETYPE_GIF);
        return $this;
    }
1133850
protected function _url( $args, $callback ) {
		foreach ( $args as $obj_id ) {
			$object = $this->fetcher->get_check( $obj_id );
			WP_CLI::line( $callback( $object->{$this->obj_id_key} ) );
		}
	}
928019
private function generateUrl()
    {
        $url = '';

        // Create the URL.
        switch ($this->link_type) {
            case self::LINK_ACTION:
                $url = action(...$this->link_value);
                break;
            case self::LINK_ROUTE:
                $url = route(...$this->link_value);
                break;
            case self::LINK_URL:
                $url = env('APP_NO_SSL', true) ? url(...$this->link_value) : secure_url(...$this->link_value);
                break;
            case self::LINK_INSECURE_URL:
                $url = url(...$this->link_value);
                break;
            case self::LINK_EXTERNAL_URL:
                $url = stripos($this->link_value[0], 'http') === false ? 'http://' : '';
                $url .= $this->link_value[0];
                break;
        }

        return $url;
    }
1142440
function getDownloadUrl() {
		$inputs = self::remoteXpathQuery($this->videoUrl, '/html/body/div[3]/div[2]/div[2]/div[7]/form/input[@name]');
		
		$postFields = [];
		foreach ($inputs as $input) {
			$postFields[$input->getAttribute('name')] = $input->getAttribute('value');
		}
		
		sleep(11);	//10 sek wait-time is required
		$scriptElements = self::remoteXpathQuery($this->videoUrl, '/html/body/div[3]/div[2]/div[2]/div[1]/script[3]', $postFields);
		
		$textContent = $scriptElements->item(0)->textContent;
		preg_match('/file: ".*\..*"/U', $textContent, $matches);
		$url = substr(reset($matches), 6);
		return trim($url, '"');
	}
478668
protected function getGoogleSitemapToolUrl()
    {
        $url = $this->toolUrl . urlencode($this->xmlSiteUrl);
        if (!GeneralUtility::isValidUrl($url)) {
            return null;
        }

        return $url;
    }
388019
public function callback($fallback_url = null)
    {
        if ($this->request->has('denied')) {
            return $this->redirect->to($fallback_url ?: $this->getFallbackUrl());
        } elseif ($this->request->has('oauth_verifier') && $this->session->has('oauth_request_verify')) {
            $this->twitter->setToken(
                $this->session->get('oauth_request_token'),
                $this->session->get('oauth_request_token_secret')
            );

            $this->session->forget('oauth_request_verify');

            $oauthVerifier = $this->request->get('oauth_verifier');

            $this->response = $this->twitter->api('POST', 'oauth/access_token', array('oauth_verifier' => $oauthVerifier));

            if ($this->responseOk()) {
                $this->session->forget('oauth_request_token');
                $this->session->forget('oauth_request_token_secret');
                $this->session->forget('oauth_request_verify');

                $data = array('oauth_token', 'oauth_token_secret', 'user_id', 'screen_name');
                foreach ($data as $key) {
                    $this->session->put("twitter.{$key}", $this->response->{$key});
                }

                return $this->response;
            }
            $this->triggerError("Invalid or expired token.");
        } else {
            $this->triggerError("To perform callback, you must authorize the user first.");
        }
    }
1248669
public function buildSlug()
    {
        $name = $this->getAttribute($this->getSluggableColumn());
        return str_slug($name . '-' . $this->getAttribute('id'));
    }
1208282
public function getMediumUrl() {

		if( $this->changed ) {

			return Yii::$app->fileManager->uploadUrl . '/' . CoreProperties::DIR_TEMP . $this->directory . "/" . $this->name . "-medium." . $this->extension;
		}
		else if( $this->id > 0 ) {

			return Yii::$app->fileManager->uploadUrl . '/' . $this->medium;
		}

		return "";
	}