Smartmove: Facebook spills its Apps over the web.

Non Technical speaking (Right from Mashable):

Numerous people have said that Facebook is like “a walled garden”; in that things do go in, but nothing comes out. It would appear that they made the first step last night in “coming out,” as it were.

Nick O’Neill of AllFacebook is reporting today that, without much fanfare, Facebook integrated their platform with their API. What does this mean to you and me? It seems that your favorite applications could possibly start popping up on ordinary websites and blogs any day now.

Web apps will be able to use cookies to track the users when they are using the app in other places on the Internet. So, in theory, you could play a game on any site and your stats will still be tracked.

The whole point of this seems to be to allow Facebook members to finally leave the site proper. Users could now go about the Web, doing your own thing, but still be connected to their Facebook profiles.

As this new development isn’t even a day old yet, there doesn’t seem to be any apps yet to demonstrate what exactly we’ll be able to do, but we can expect to learn the extent of the new development very soon - perhaps even as early as Monday morning. You can read up on all of the technical aspects of the “JavaScript Client Library for Facebook API” over at the Facebook Developers blog.

And Technical Speaking:

Wei Zhu seems to be cooking with gas recently, and has released the JavaScript Client Library for Facebook API, which is a client side JavaScript library that mimics the other language client libraries (PHP, Python, Java, Ruby, etc):

An application that uses this client library should be registered as an iframe type. This applies to either iframe Facebook apps that users access through the Facebook web site or apps that users access directly on the app’s own web sites.

The solution uses a cross domain receiver:

Front side:

<pre name=”code” class=”html”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>cross domain receiver page</title>
</head>
<body style=”background-color:Green;”>
<script src=”http://static.ak.facebook.com/js/api_lib/XdCommReceiver.debug.js” type=”text/javascript”></script>
<script type=”text/javascript”>
FB_ReceiverApp$main();
</script>
</body>
</html>

</pre>

And the src JavaScript:

<pre name=”code” class=”javascript”>

// Create an ApiClient object, passing app’s api key and
// a site relative url to xd_receiver.htm
var api = new FB.ApiClient(’<insert_your_app_key_here’, ‘/xd_receiver.htm’, null);

// require user to login

api.requireLogin(function(exception) {
window.alert(“Current user id is “ + api.get_session().uid);

// Get friends list
api.friends_get(function(result, exception) {
Debug.dump(result, ‘friendsResult from non-batch execution ‘);
});
});

</pre>

It is good to see a JavaScript API like this. Now you can stay in JavaScript land and write code that works with OpenSocial, Facebook, and more. NOTE: If you live in FBML? No cigar.

Sphere: Related Content

Print This Post Print This Post

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)