oEmbed, as the wikipedia page puts it, is an open format for obtaining an embeddable representation of an object. As suggested in the comments in an earlier post, I’ve now extended my Idno Embedded post plugin to support oEmbed.
It works by providing an endpoint that other sites can query, passing the permalink of the thing they’re wanting to embed, a format parameter (currently only
json is supported), and any other content specific parameters (e.g.
You can pass a permalink of an idno post to this endpoint, and you’ll be returned a JSON data structure containing some details about it. Additionally, if you pass a
callback parameter, you’ll get this data as JSONP, which may be more useful.
Here’s some example code, using jQuery for convenience:
This example makes use of the JSONP callback to update all div elements of class
oembed, with the URL from the
Currently, all posts will default to the
'rich' data type, however you can extend this by providing your own entity class templates and provide specific details for your own custom types.