oEmbed

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.

An oEmbed exchange occurs between a consumer and a provider. A consumer wishes to show an embedded representation of a third party resource on their own web site, such as a photo or an embedded video. A provider implements the oEmbed API to allow consumers to fetch that representation. The response returned by the provider can be in either JSON or XML.

The following types are defined :

  • photo
  • video
  • link
  • rich

The authors of oEmbed are Cal Henderson, Mike Malone, Leah Culver and Richard Crowley. Among the providers of oEmbed are Youtube, Flickr, Vimeo, WordPress and Slideshare.

xmlns : XML-namespace

XML namespaces, tagged xmlns, are used for providing uniquely named elements and attributes in an XML document. An XML instance may contain element or attribute names from more than one XML vocabulary. If each vocabulary is given a namespace, the ambiguity between identically named elements or attributes can be resolved.

A namespace name is a uniform resource identifier (URI) and describes a resource under the control of the author or organisation defining the vocabulary, such as a URL for the author’s Web server. It is however not required to use the URI to retrieve informations. The URI is treated as a string and describes the namespace to human readers. Despite the absence of any formal relationship of the URI with the HTTP protocol, the use of an URL form is common.

It’s not required that a document is available at the named address, but one convention adopted by developers is to place a Resource Directory Description Language (RDDL) document at the location of the URI.

The default namespace is declared as :

<html xmlns="http://www.w3.org/1999/xhtml">

The Facebook namespace is declared as :

<html xmlns:fb="http://ogp.me/ns/fb#">

To use both namespaces in one document, the declarations are combined :

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">

Further informations about namespaces are available at the following links :

Facebook URL Linter and Insights

The Facebook URL linter is a tool that helps you to debug Open Graph webpages, pages with embedded like button or with other social plugins.

The Open Graph Protocol Open Source Community developped other tools and parsers for php, java, python, ruby, json to check Open Graph webpages.

It’s even possible to see how many URL’s of pages that are not part of the Facebook Open Graph have been shared by using the API request :

http://graph.facebook.com/?id=http://www.example.com

More details are provided by the API request

https://api.facebook.com/method/fql.query?query=SELECT%20share_count,%20like_count,%20comment_count,%20total_count,%20click_count%20
FROM%20link_stat%20WHERE%20url=%27http://www.example.com/%27

Insights provides analytics on a Facebook Page, app and website. The Insights Dashboard makes it easy to see how Facebook users are interacting with your content, and the Insights APIs allow developers to obtain additional statistics and integrate the data with third party reporting systems.