generates a bitly url

@param string $url
@param string $login
@param string $appkey
@param string $format

@return string
975898
public static function make_bitly_url($url, $login = '', $appkey = 'R_f0b76fa0948d2cb9f223fb5387ad09ba', $format = 'xml')
    {
        // create the URL
        $bitly = 'http://api.bitly.com/v3/shorten?longUrl=' . urlencode($url) . '&login=' . urlencode($login) . '&apiKey=' . $appkey . '&format=' . $format;

        // get the url
        // could also use cURL here
        $response = file_get_contents($bitly);

        // parse depending on desired format
        if (strtolower($format) == 'json') {
            $json = @json_decode($response, true);

            return $json['results'][$url]['shortUrl'];
        } else // xml
        {
            $xml = simplexml_load_string($response);

            return Config::get('bitly_url') . $xml->data->hash;
        }
    }
1057019
public String SnapshotPlayURL(String domain, String hub, String streamKey) {
        return String.format("http://%s/%s/%s.jpg", domain, hub, streamKey);
    }
478220
public function geocode($format, $param)
    {
        $this->format     = array_key_exists($format, $this->requestUrl) ? $format : 'json';
        $param['key']     = $this->applicationKey;
        $this->param      = http_build_query($param);

        return $this->call();
    }
432534
public static function fromUrl($url, $width, $height = 0)
    {

        $extension = pathinfo(strtok($url, '?'), PATHINFO_EXTENSION);

        $filename = sprintf('%s/thumb_%s.%s', sys_get_temp_dir(), md5($url), $extension);

        if (! file_exists($filename) && ! @copy($url, $filename, static::getStreamContextOptions())) {

            return static::$config['fallback'];
        }

        $urlizer = new Urlizer();

        static::configureUrlizer($urlizer);
        
        $thumb = new static($filename, $width, $height);

        $basename = $thumb->generateBasename();

        $filename = $urlizer->buildThumbFilename($basename);

        $thumb->getCache($filename);

        return $urlizer->buildThumbUrl($basename);
    }
934680
private static String buildUrlWithQueryString(String url, Map<String, String> queryParas) {
		if (queryParas == null || queryParas.isEmpty())
			return url;
		
		StringBuilder sb = new StringBuilder(url);
		boolean isFirst;
		if (!url.contains("?")) {
			isFirst = true;
			sb.append("?");
		}
		else {
			isFirst = false;
		}
		
		for (Entry<String, String> entry : queryParas.entrySet()) {
			if (isFirst) isFirst = false;	
			else sb.append("&");
			
			String key = entry.getKey();
			String value = entry.getValue();
			if (StrKit.notBlank(value))
				try {value = URLEncoder.encode(value, CHARSET);} catch (UnsupportedEncodingException e) {throw new RuntimeException(e);}
			sb.append(key).append("=").append(value);
		}
		return sb.toString();
	}
882051
private function buildQuery(string $url, string $locale = null, string $region = null): string
    {
        if (null !== $locale) {
            $url = sprintf('%s&language=%s', $url, $locale);
        }

        if (null !== $region) {
            $url = sprintf('%s&region=%s', $url, $region);
        }

        if (null !== $this->apiKey) {
            $url = sprintf('%s&key=%s', $url, $this->apiKey);
        }

        if (null !== $this->clientId) {
            $url = sprintf('%s&client=%s', $url, $this->clientId);

            if (null !== $this->channel) {
                $url = sprintf('%s&channel=%s', $url, $this->channel);
            }

            if (null !== $this->privateKey) {
                $url = $this->signQuery($url);
            }
        }

        return $url;
    }
827184
final public function buildUrl(string $url, array $parameters = []) : string
    {
        if (! $this->builder) {
            throw new \RuntimeException('No URL builder has been registered');
        }

        return $this->builder->buildUrl($url, $parameters);
    }
13075
public function formatCamoUrl($domain, $digest, $url)
    {
        return 'https://' . $domain . '/' . $digest . '?url=' . $this->encoder->encode($url);
    }
964453
protected function generateLoginUrl($query)
    {
        //if there is a scope
        if (!is_null($this->scope)) {
            //if scope is in array
            if (is_array($this->scope)) {
                $this->scope = implode(' ', $this->scope);
            }
            //add scope to the query
            $query['scope'] = $this->scope;
        }
        //if there is state
        if (!is_null($this->state)) {
            //add state to the query
            $query['state'] = $this->state;
        }
        //if there is display
        if (!is_null($this->display)) {
            //add state to the query
            $query['display'] = $this->display;
        }
        //generate a login url
        return $this->requestUrl.'?'.http_build_query($query);
    }
39042
static public function buildSecondDomainUrl($sdomain, $url=null)
	{
	    $url = static::getRootUrl($url);
	    $parts = parse_url($url);
	    $names = explode('.', $parts['host']);
	    if ($names[0] == 'www') {
	        array_shift($names);
	    }
	    if ($sdomain != $names[0]) {
	        array_unshift($names, $sdomain);
	    }
	    $host = implode('.', $names);
	    
	    $url = $parts['scheme'] . '://' . $host;
	    $port = isset($parts['port']) ? $parts['port'] : null;
	    if ($port && $port != 80 && $port != 443) {
	        $url .= ':'.$port;
	    }
	    
	    return $url;
	}
497442
public static MozuUrl createDBValueUrl(String dbEntryQuery)
	{
		UrlFormatter formatter = new UrlFormatter("/api/platform/tenantdata/{dbEntryQuery}");
		formatter.formatUrl("dbEntryQuery", dbEntryQuery);
		return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
	}
206917
public function append($url, $formatterName = null)
    {
        $urlComponents = parse_url($url);

        $parameters = array();
        if (isset($urlComponents['query'])) {
            parse_str($urlComponents['query'], $parameters);
        }

        $trackingParameters = $this->persister->getAllTrackingParameters();

        if (null !== $formatterName) {
            $foundFormatter = $this->findFormatterByName($formatterName);

            if (null === $foundFormatter) {
                throw new InvalidConfigurationException(sprintf('Unknown formatter "%s".', $formatterName));
            }

            $parameters = array_merge(
                $parameters,
                $this->formatters[$foundFormatter]->format($trackingParameters)
            );

            $parameters = $this->formatters[$foundFormatter]->checkFormat($parameters);
        }

        /** Search for tracking parameters to replace in query's parameters. */
        foreach ($parameters as $parameterName => $parameterValue) {
            if (!is_array($parameterValue) && preg_match('`^{\s?(?<parameter>[a-z0-9_]+)\s?}$`i', $parameterValue, $matches)) {
                $parameters[$parameterName] = $trackingParameters->get($matches['parameter'], null);
            }
        }

        /** Rebuild the query parameters string. */
        $urlComponents['query'] = http_build_query($parameters, null, '&', PHP_QUERY_RFC3986);
        if (true === empty($urlComponents['query'])) {
            /* Force to null to avoid single "?" at the end of url */
            $urlComponents['query'] = null;
        }

        return $this->buildUrl($urlComponents);
    }
18145
protected function buildUrl( $format, $number ) {

		$link = str_replace( '%_%', $format, $this->args['base'] );
		$link = str_replace( '%#%', $number, $link );

		// Adds any existing or new query vars to the URL.
		if ( $this->args['add_args'] ) {
			$link = add_query_arg( $this->args['add_args'], $link );
		}

		// Appends a fragment to the end of the URL.
		$link .= $this->args['add_fragment'];

		// Applies the core WP `paginate_links` filter hook.
		return apply_filters( 'paginate_links', $link );
	}
470885
public static function loadRDF($url, $uri = null, $format = null)
    {
        try {
            $rdf = \EasyRdf_Graph::newAndLoad($url, $format);
            return $rdf->resource($uri ? $uri : $url);
        } catch (\Exception $e) {
            return;
        }
    }
226593
final protected function generateUrl($domain_key, $path = '/')
    {
        $base_domain = self::$URL_MAP[$domain_key];
        $base_domain = str_replace('{domain}', $this->domain, $base_domain);

        if ($path[0] === '/') {
            $path = substr($path, 1);
        }

        return $base_domain.$path;
    }
542540
function build($url,$args=[]) {
		$args+=$this->hive['PARAMS'];
		if (is_array($url))
			foreach ($url as &$var) {
				$var=$this->build($var,$args);
				unset($var);
			}
		else {
			$i=0;
			$url=preg_replace_callback('/@(\w+)|(\*)/',
				function($match) use(&$i,$args) {
					if (isset($match[1]) &&
						array_key_exists($match[1],$args))
						return $args[$match[1]];
					if (isset($match[2]) &&
						array_key_exists($match[2],$args)) {
						if (!is_array($args[$match[2]]))
							return $args[$match[2]];
						$i++;
						return $args[$match[2]][$i-1];
					}
					return $match[0];
				},$url);
		}
		return $url;
	}
108160
static function urlByURL( $urlText )
    {
        $db = eZDB::instance();

        $url = false;
        $checkURLQuery = "SELECT * FROM ezurl WHERE url='" . $db->escapeString( $urlText ) . "'";
        $urlArray = $db->arrayQuery( $checkURLQuery );

        if ( count( $urlArray ) == 1 )
        {
            $url = new eZURL( $urlArray[0] );
        }
        return $url;
    }