extract() public method

Fetches informations about the given URL.
public extract ( string $url, array $options = [] ) : Essence\Media
$url string URL to fetch informations from.
$options array Custom options to be interpreted by a provider.
return Essence\Media Embed informations.
Example #1
0
 /**
  *	Returns a function used to replace URLs by informations.
  *
  *	@see replace()
  *	@param callable $template Templating callback.
  *	@param array $options Custom options to be interpreted by a provider.
  *	@return \Closure Function.
  */
 protected function _replaceFunction($template, array $options)
 {
     return function ($matches) use($template, $options) {
         $url = $matches[0];
         $Media = $this->_Extractor->extract($url, $options);
         return $Media ? $template($Media) : $url;
     };
 }