protected function fetchEndpointForUrl($url)
    {
        $endPoint = null;

        try {
            $content = $this->browser->getContent($url);
        } catch (Exception $exception) {
            throw new Exception(
                'Unable to fetch the page body for "' . $url . '": ' . $exception->getMessage(),
                Exception::PAGE_BODY_FETCH_FAILED
            );
        }

        preg_match_all("/<link rel=\"alternate\"[^>]+>/i",
            $content,
            $out);
        if ($out[0]) {
            foreach ($out[0] as $link) {
                if (strpos($link, trim($this->preferredFormat . '+oembed')) !== false) {
                    $endPoint = $this->extractEndpointFromAttributes($link);
                    break;
                }
            }
        } else {
            throw new Exception(
                'No valid oEmbed links found on the document at "' . $url . '".',
                Exception::NO_OEMBED_LINKS_FOUND
            );
        }

        return $endPoint;
    }
protected function fetchEndpointForUrl($url)
    {
        $endPoint = null;

        try {
            $content = $this->browser->getContent($url);
        } catch (Exception $exception) {
            throw new Exception(
                'Unable to fetch the page body for "' . $url . '": ' . $exception->getMessage(),
                Exception::PAGE_BODY_FETCH_FAILED
            );
        }

        preg_match_all("/<link rel=\"alternate\"[^>]+>/i",
            $content,
            $out);
        if ($out[0]) {
            foreach ($out[0] as $link) {
                if (strpos($link, trim($this->preferredFormat . '+oembed')) !== false) {
                    $endPoint = $this->extractEndpointFromAttributes($link);
                    break;
                }
            }
        } else {
            throw new Exception(
                'No valid oEmbed links found on the document at "' . $url . '".',
                Exception::NO_OEMBED_LINKS_FOUND
            );
        }

        return $endPoint;
    }
protected function fetchEndpointForUrl ( $ url ) { $ endPoint = null ; try { $ content = $ this -> browser -> getContent ( $ url ) ; } catch ( Exception $ exception ) { throw new Exception ( 'Unable to fetch the page body for "' . $ url . '": ' . $ exception -> getMessage ( ) , Exception :: PAGE_BODY_FETCH_FAILED ) ; } preg_match_all ( "/<link rel=\"alternate\"[^>]+>/i" , $ content , $ out ) ; if ( $ out [ 0 ] ) { foreach ( $ out [ 0 ] as $ link ) { if ( strpos ( $ link , trim ( $ this -> preferredFormat . '+oembed' ) ) !== false ) { $ endPoint = $ this -> extractEndpointFromAttributes ( $ link ) ; break ; } } } else { throw new Exception ( 'No valid oEmbed links found on the document at "' . $ url . '".' , Exception :: NO_OEMBED_LINKS_FOUND ) ; } return $ endPoint ; }
Fetch the provider's endpoint URL for the supplied resource.

@param string $url The provider's endpoint URL for the supplied resource.
@return string
@throws \Ttree\Oembed\Exception
@todo is not endpoint is found try other format (supportedFormat)
Fetch the provider s endpoint URL for the supplied resource .