Saying stuff about stuff.

What is oEmbed and why is it useful?

From the oEmbed site [1]:

oEmbed is a format for allowing an embedded representation of a URL on third party sites.

Cool… what?

For example Vimeo will return the HTML required to embed one of its videos - oEmbed is particularly useful for videos [2].

http://vimeo.com/api/oembed.xml?url=http://www.vimeo.com/935317

<?xml version="1.0" encoding="UTF-8"?>
<oembed>
  <type>video</type>
  <version>1.0</version>
  <provider_name>Vimeo</provider_name>
  <provider_url>http://vimeo.com/</provider_url>
  <title>Weird Fishes: Arpeggi</title>
  <author_name>flight404</author_name>
  <author_url>http://vimeo.com/flight404</author_url>
  <is_plus>1</is_plus>
  <html><![CDATA[<object type="application/x-shockwave-flash" width="504" height="348" data="http://vimeo.com/moogaloop.swf?clip_id=935317&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00ADEF">
  <param name="quality" value="best" />
  <param name="allowfullscreen" value="true" />
  <param name="scale" value="showAll" />
  <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=935317&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00ADEF" />
</object>]]></html>
  <width>504</width>
  <height>348</height>
  <duration>318</duration>
  <thumbnail_url>http://20.media.vimeo.com/d1/5/57/04/55/thumbnail-57045532.jpg</thumbnail_url>
  <thumbnail_width>160</thumbnail_width>
  <thumbnail_height>120</thumbnail_height>
  <clip_id>935317</clip_id>
</oembed>

Hidden away amongst the cruft you can see that the html element contains their movie player embed code.

Why?

Think bookmarks, tumbles and other such delights. It’s like a rich meta description - though that sounds awfully close to being a cringe-worthy marketing buzzword creating developer cynicism.

Resources

                         __                 __
                        /\ \               /\ \
  ___      __    ___ ___\ \ \____     __   \_\ \
 / __`\  /'__`\/' __` __`\ \ '__`\  /'__`\ /'_` \
/\ \L\ \/\  __//\ \/\ \/\ \ \ \L\ \/\  __//\ \L\ \
\ \____/\ \____\ \_\ \_\ \_\ \_,__/\ \____\ \___,_\
 \/___/  \/____/\/_/\/_/\/_/\/___/  \/____/\/__,_ /

 ===== because 'open embed' sounds too dirty =====

[1] Gotta love their ASCII art:

[2] One could argue that embedding videos is all it’s really useful for at the moment as it seems to be most popular among video services (not YouTube!) but that’s a discussion for another day.