Cover by Diomidis Spinellis, Georgios Gousios

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Creating a Social Web Service

Looking back on an example as simple as http://fettermansbooks.com, it becomes clear that most Internet applications would benefit from added social context for the data they present. However, we run into a product problem: the availability of that data.

product problem: Applications could make use of a user’s social data on Facebook, but this data is inaccessible.

data solution: Make Facebook data available through an externally accessible web service (Figure 6-2).

The addition of the Facebook API to Facebook’s architecture begins the relationship between external applications and Facebook through the Facebook Platform, essentially adding Facebook’s data to the external application’s stack. For a Facebook user, this integration begins when he explicitly authorizes the outside application to obtain social data on his behalf.

The application stack consumes Facebook data as web service

Figure 6-2. The application stack consumes Facebook data as web service

Example 6-4 shows what the code behind the landing page of http://fettermansbooks.com might look like without any Facebook integration.

Example 6-4. Example book site logic

$books_user_id = establish_booksite_userid($_REQUEST);
$book_infos = user_get_likely_books($books_user_id);
display_books($book_infos);

This user_get_likely_books function operates entirely from the data that the book application controls, possibly using clever relevance techniques to guess at a user’s ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required