A Real-World Example: The Facebook Open Graph

The Facebook implementation of the Open Graph protocol (http://developers.facebook.com/docs/opengraph) allows a site owner to represent his site, business, or product page as if it were a Facebook page, without it actually residing in the social network.

The Facebook Open Graph consists of a few pieces, implemented by a site owner:

  • The Open Graph protocol <meta> tags to define the site object

  • A few Facebook administration tags

  • The Facebook Like button

It currently only supports web pages that represent real-world things such as sports teams, movies, actors, restaurants, etc.

The Facebook Like button is a simple page implementation that displays a button with the word Like on it. When a user likes a page, his name and profile—as well as those of any of his friends who have liked the same page—is displayed, as shown in Figure 10-2.

The Facebook Like button on a website

Figure 10-2. The Facebook Like button on a website

Once the user clicks Like, he is connected to the page containing the Like button, and the like instance is subsequently published on his profile. The Like button is included on a page via either an iframe or the Facebook JavaScript API and the <fb:like> XFBML tag.

Under the likes and interests sections of the user’s profile, the new like instance will be displayed, and under his news feed’s recent activity, a like notice will be posted (Figure 10-3).

Figure 10-3. How a ...

Get Programming Social Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.