What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

From the oEmbed site:

oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.

This would be great for third party sites to embed questions. Here's how it could work:

StackOverflow creates an oEmbed endpoint that takes a url-encoded URL as a parameter. Any site that wants to embed a URL will call it like this:

Format:

http://stackoverflow.com/oembed.{format}?url={url}

Example:

http://stackoverflow.com/oembed.json?url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F2193953%2Fflash-cs4-refuses-to-let-go

It would then reply with a representation of that URL that can be embedded nicely:

{
    "version": "1.0",
    "type": "link",
    "width": 300,
    "height": 100,
    "title": "Flash CS4 refuses to let go",
    "url": "http://stackoverflow.com/questions/2193953/flash-cs4-refuses-to-let-go",
    "author_name": "Ender",
    "author_url": "http://stackoverflow.com/users/134658/ender",
    "provider_name": "Stack Overflow",
    "provider_url": "http://stackoverflow.com/"
    "html": "<html code that will display the question / answer embedded will be here>"
}

Additionally, it could be adjusted to return rich html, which would be nice if we wanted to include the score, or the user's avatar or something. That can be done with a type of 'rich'.

The oEmbed should also be discoverable, by adding a link tag to the document:

<link rel="alternate" type="application/json+oembed" href="stackoverflow.com/oembed.json?url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F2193953%2Fflash-cs4-refuses-to-let-go" title="Flash CS4 Refuses to Let Go" />

There are quite a few sites that already support oEmbed with great success such as YouTube, Flickr, Vimeo, Slideshare and WordPress. Here's an example of an oEmbed response from YouTube (that is easily taken from their autodiscovery tag.)

share|improve this question
9  
Could go the other way for one boxing in chat if this isn't already used for that. –  Flexo Jun 15 '12 at 19:30
4  
Please also make it have JSONP handling like a lot of other oEmbed endpoints do. It makes it easier for client only applications. I also write a library that does a stack overflow embedding see github.com/starfishmod/jquery-oembed-all this may help in the meantime? –  user190930 Jul 18 '12 at 1:38
1  
Author name should be Ender –  hjpotter92 Apr 9 '13 at 0:55
1  
Seems like a bit of an XSS nightmare with the scrubbing necessary for every oEmbed being displayed... –  Chris S Jun 8 '13 at 3:40
    
@ChrisS: …what? –  U2744 SNOWFLAKE Jun 8 '13 at 4:45
    
As an aside: YouTube (nowadays) returns an iframe (plus the meta data). The Speaker Deck example doesn't work for me today. –  Arjan Aug 7 '13 at 6:24

1 Answer 1

This would be great, and could we do it like youtube embeds, where it links back to SO if you click the title.

share|improve this answer
10  
Did you miss the "add comment" link below the question? –  Shadow Wizard Oct 6 '13 at 10:23
1  
@ShaWizDowArd I'm sorry. I didn't realize this was Meta. –  Cole Johnson Oct 6 '13 at 17:17
2  
@ColeJohnson are you and MarJamRob the same person?? –  Shadow Wizard Oct 6 '13 at 21:05
10  
@ShaWizDowArd oh crap. –  Cole Johnson Oct 6 '13 at 22:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .