/** * Actually do an oEmbed lookup to a particular API endpoint. * * @param string $api oEmbed API endpoint URL * @param string $url target URL to look up info about * @param array $params * @return object */ static function getOembedFrom($api, $url, $params = array()) { if (empty($api)) { // TRANS: Server exception thrown in oEmbed action if no API endpoint is available. throw new ServerException(_('No oEmbed API endpoint available.')); } $params['url'] = $url; $params['format'] = 'json'; $key = common_config('oembed', 'apikey'); if (isset($key)) { $params['key'] = common_config('oembed', 'apikey'); } return HTTPClient::quickGetJson($api, $params); }