GET /oembed?url=... json by default
 GET /oembed.json?url=...
 GET /oembed.json?url=...&callback=myCallback
 GET /oembed.xml?url=...
170806
def endpoint
      # get object that we want an oembed_response from
      # based on url
      # and get its oembed_response
      media_item = ::OembedProviderEngine::OembedProvider.find_provided_from(params[:url])
      options = Hash.new
      max_dimensions = [:maxwidth, :maxheight]
      unless media_item.class::OembedResponse.providable_oembed_type == :link
        max_dimensions.each { |dimension| options[dimension] = params[dimension] if params[dimension].present? }
      end

      @oembed_response = media_item.oembed_response(options)

      # to_xml and to_json overidden in oembed_providable module
      # to be properly formatted
      # TODO: handle unauthorized case
      respond_to do |format|
        if @oembed_response
          format.html { render_json @oembed_response.to_json } # return json for default
          format.json { render_json @oembed_response.to_json }
          format.xml  { render :xml => @oembed_response }
        else
          format.all { render_404 }
        end
      end
    end
822127
function get(url, shouldParse, callback) {
    request(url, function (err, response, body) {
        if (err) {
            console.error('Error making GET request to endpoint ' + url);
      callback(shouldParse ? {} : "{}");
        }

        if (response.statusCode !== 200) {
            console.error('non 200 response for URL: ' + url);
            callback(shouldParse ? {} : "{}");
            return;
        }

        var toReturn = shouldParse ? JSON.parse(body) : body;
        callback(toReturn);
        return;
    });
}
1266507
function getUrlParamsObjectified(urlParams, object) {
  let urlParamsObjectified = {};
  // default: get url param field and description as matched to db column names
  // allow user to specify url params that don't match perfectly with db columns
  for(let urlParam of urlParams) {
    if (urlParam !== null && typeof urlParam === 'object' && urlParam.field) {
      urlParamsObjectified[urlParam.field] = urlParam;
    } else {
      urlParamsObjectified[urlParam] = object[urlParam];
    }
  }
  return urlParamsObjectified;
}
296033
function (callback) {
      return this._request({
        path: this._extension
      }, function (err, body, res) {
        return err
          ? callback(err)
          : callback(null, body.networks, res);
      });
    }
1123551
function getText(obj, why) {
  // TODO: links ignored for now, patched for types for
  var GENERATE_LINK = function(x) { return x + ' '; }
  return _.reduce(obj.children, function(text, elem) {
    if (_.isString(elem)) {
      return text += elem.trim() + ' ';
    } else if (_.isPlainObject(elem)) {
      switch(elem.name) {
        case 'para':
          return text += getText(elem, why) + '  \n';
        case 'ref':
          return text += GENERATE_LINK(getText(elem, why));
        case 'parameterlist':
        case 'simplesect':
          return text; // to be handled elsewhere
        case 'programlisting':
        case 'htmlonly':
          return text; // ignored
        // TODO: html doesn't seem to work for yuidoc, using markdown for now
        case 'itemizedlist':
          return text += '\n' + getText(elem, why) + '  \n  \n';
        case 'listitem':
          return text += '+ ' + getText(elem, why) + '\n';
        case 'bold':
          return text += '__' + getText(elem, why).trim() + '__ ';
        case 'ulink':
          return text += '[' + getText(elem, why).trim() + '](' + getAttr(elem, 'url').trim() + ') ';
        case 'image':
          // TODO: copy images over; hard coded for now
          var fn = getAttr(elem, 'name');
          return text += '  \n  \n![' + fn + '](' + xml2js.opts.imagedir + '/' + fn + ') ';
        case 'linebreak':
          return text += '  \n';
        case 'ndash':
          return text += '&ndash; ';
        default:
          // TODO: incomplete list of doxygen xsd implemented
          console.warn('NYI Unknown Object Type: ' + elem.name);
          return text;
          //throw new Error('NYI Unknown Object Type: ' + elem.name);
      }
    } else {
      throw new Error('NYI Unknown Type: ' + (typeof elem));
    }
  }, '').trim();
}
347208
def get(self, default=None, callback=None):
        """
        value = self._xml.text if self._xml.text else default
        return callback(value) if callback else value
1123195
def json_data(self, instance, default=[]):
        
        value = self.get(instance)
        out = map(api.get_url_info, value)
        return out or default
815319
def get_oembed_data(url, max_width=None, max_height=None, **params):
    
    if max_width:  params['maxwidth'] = max_width
    if max_height: params['maxheight'] = max_height

    registry = get_oembed_providers()
    return registry.request(url, **params)
1214231
function querySearch( query, single, embed, callback ) {
    var embd = '';
        if ( single ) {
        for ( var key in embed ) {
            if (  embed.hasOwnProperty(key) ) {
                embd += '&embed[]=' + embed[key];
            }
        }
    }

    var url = apiBaseUrl + ( single ? endpoints['query']['single'] : endpoints['query']['multi'] ) + query + embd;

    fetch(url, function(result) {
        callback(result);
    });
}
1271899
def addUrlScheme(self, url):
        '''
        
        '''

        #@TODO: validate invalid url format according to http://oembed.com/
        if not isinstance(url, str):
            raise TypeError('url must be a string value')

        if not url in self._urlSchemes:
            self._urlSchemes[url] = OEmbedUrlScheme(url)
228447
function(params, callback) {
                getImageData = {};

                if (params) {
                    if (parseInt(params.imageId) > 0) {
                        getImageData.imageId = params.imageId;
                    }

                    if (typeof params.hashCode == 'string') {
                        getImageData.hashCode = params.hashCode;
                    }

                    if (parseInt(params.width) > 0) {
                        getImageData.width = params.width;
                    }

                    if (parseInt(params.height) > 0) {
                        getImageData.height = params.height;
                    }

                    if (parseInt(params.actual) > 0) {
                        getImageData.actual = params.actual;
                    }

                    if (parseInt(params.downloadable) > 0) {
                        getImageData.downloadable = params.downloadable;
                    }
                }

                httpRequest({
                    url: SERVICE_ADDRESSES.FILESERVER_ADDRESS + SERVICES_PATH.GET_IMAGE,
                    method: 'GET',
                    data: getImageData
                }, function(result) {
                    if (!result.hasError) {
                        var queryString = '?';
                        for (var i in params) {
                            queryString += i + '=' + params[i] + '&';
                        }
                        queryString = queryString.slice(0, -1);
                        var image = SERVICE_ADDRESSES.FILESERVER_ADDRESS + SERVICES_PATH.GET_IMAGE + queryString;
                        callback({
                            hasError: result.hasError,
                            result: image
                        });
                    }
                    else {
                        callback({
                            hasError: true
                        });
                    }
                });
            }
716298
function get (url, callback) {
  https.get(url, function onResponse (res) {
    if (res.statusCode !== 200) {
      callback(new Error('got status code ' + res.statusCode + ' from ' + URL))
    } else {
      getBody(res, true, callback)
    }
  })
}
781294
def _get_url(method,
             api_url,
             api_version):
    '''
    
    '''
    return '{url}/{version}/{method}.json'.format(url=api_url,
                                                  version=float(api_version),
                                                  method=method)
824996
def get(provider_name, node_type_name)
      name = "#{provider_name}/#{node_type_name}/"
      response = http_get(resource_url(name))
      format_object(response, TYPE)
    end
360020
function get(uri, locals) {
  const name = getLayoutName(uri),
    model = name && files.getLayoutModules(name),
    callHooks = _.get(locals, 'hooks') !== 'false',
    reqExtension = _.get(locals, 'extension'),
    renderModel = reqExtension && files.getLayoutModules(name, reqExtension),
    executeRender = model && _.isFunction(model.render) && callHooks;

  return models.get(model, renderModel, executeRender, uri, locals);
}
1063852
def base_url(self):
        ''''''
        config_value = self.config.get('url')
        if config_value:
            return self._clean_url(config_value)
        default_url = current_app.config.get('FS_URL')
        default_url = current_app.config.get('{0}URL'.format(self.backend_prefix), default_url)
        if default_url:
            url = urljoin(default_url, self.name)
            return self._clean_url(url)
        return url_for('fs.get_file', fs=self.name, filename='', _external=True)
128645
def oembed(url, params=""):
    
    # Note: this method isn't currently very efficient - the data isn't
    # cached or stored.
    kwargs = dict(urlparse.parse_qsl(params))

    try:
        return mark_safe(get_oembed_data(
            url,
            **kwargs
        )['html'])
    except (KeyError, ProviderException):
        if settings.DEBUG:
            return "No OEmbed data returned"
        return ""