'Get the oEmbed response for a URL, if any exists.
Spec: http://www.oembed.com/
Optional parameters (parent, live) are passed through as embed options
to oEmbed renderers.'

@validate(url=VUrl('url'), parent=VBoolean('parent', default=False), live=VBoolean('live', default=False), omitscript=VBoolean('omitscript', default=False))
def GET_oembed(self, url, parent, live, omitscript):

    response.content_type = 'application/json'
    thing = url_to_thing(url)
    if (not thing):
        abort(404)
    embed_options = {'parent': parent, 'live': live, 'omitscript': omitscript}
    try:
        return scriptsafe_dumps(_oembed_for(thing, **embed_options))
    except ForbiddenError:
        abort(403)
    except NotImplementedError:
        abort(404)
