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.

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access