xfbml – Stay N Alive

Facebook to Launch SideWiki-like Recommendation System for Websites

On Saturday I broke news of a few specific XFBML tags Facebook will be releasing as part of its OpenGraph API, as revealed by their open source Javascript Client libraries.  I held back one announcement that I think is almost just as interesting as their Insights for websites, or the SocialBar, which will provide Meebo-like functionality for Facebook on any website (I think it’s no coincidence Meebo, Google, and Yahoo announced XAuth shortly after I wrote that post).  Facebook, in conjunction with F8, is getting ready to launch “fb:recommendations”, a tag which enables users to provide recommendations to other Facebook users on any OpenGraph-enabled website.

Currently in Facebook’s open source Javascript client libraries, the tag can be placed on any website, and, according to the check in for the code on Github, something like this:

“should be replaced by an iframe showing recommendations for the abc website.”  Rendering the code currently just displays an iframe with the Facebook.com website in the frame.  I am assuming when they turn it on to the world that will render something completely different.

If my theories (and a few sources close to Facebook) are correct, Facebook will soon be releasing the ability for any Facebook user to provide recommendations and advice on any website that integrates the recommendations widget.  Think Google Sidewiki, but at the discretion of each website.  The functionality I am guessing will work similar to that of Foursquare’s “Tips” feature.

What makes this feature even more interesting is what this could bring if some of the rumors of GeoLocation being launched are true.  Is this just a sidewiki feature, or could Facebook be getting ready to launch a Geolocation feature, enabling “Recommendations” that go beyond just websites into real-life locations and places?

Be sure to read more about FBML, including a very beginner lesson on XFBML, in my book, FBML Essentials.

More "Insights" on the Facebook Open Graph API Surface

With Facebook’s F8 Developer’s conference right around the corner, there is a flurry of activity happening as the Facebook team rushes to prepare for many launches at the Conference.  While I know more than I am saying, there is some evidence in plain view, open for all that we know for sure will be launched at the conference which you should prepare for.  Specifically, I’ve already shared information about Facebook’s XFBML tag to enable any website on the web to be “liked” and shared amongst a user’s friends.  While not currently functional, this information was made clear in Facebook’s Open Source Javascript Client libraries available here on their GitHub open source repository (and available to all).  There is much more those libraries reveal though (some which have been there for months), hinting at what could very well become a “Facebook-less” connection to the entire web, making it much less necessary to go back and forth between the Facebook.com website to interact with Facebook on a day-to-day basis.  Here is what we know:

There will be a tag that website administrators and developers can stick onto any website that enables a live stream of just that website’s activity on Facebook.  According to the check in on GitHub, the tag accepts the following parameters:

- site (string): mandatory, site url (ie : facebook.com)
- activities (int): number of activities to display.
- width
- height
- header (boolean): indicates if the header should be displayed or not.

Assuming I understand it right, if you use the sample from the GitHub check in, code like the following would display an activity stream for all posts to Facebook from the CNN.com website:


It’s quite unclear what these are going to do exactly.  One has to expect it is something like the Meebo bar, which puts a bar at the bottom of any Connect (or Open Graph API) enabled website.  The two seem to work together, and, from the code, the fb:connectBar tag seems to prompt each visitor with text that says,

“Hi {firstName}. {siteName} is using to personalize your experience.”

There is an option to click to learn more.  My guess is that is just a way for website owners to spread more word about Facebook Connect to their visitors.  I’m assuming uses as part of the bar website owners place at the bottom (or elsewhere) of their website.  Right now it seems the way to implement is to just place “” or “” in your website somewhere after calling the Facebook Javascript libraries.

Insights for Websites

Perhaps the most intriguing part of the and tags is that they both make a call to a new API method, FB.impression.  The interesting call in the Open Source Client libraries source code is:

FB.provide('Insights',{impression:function(e,a){var b=FB.guid(),g="//ah8.facebook.com/impression.php/"+b+"/",c=new Image(1,1),f=[];if(!e.api_key&&FB._apikey)e.api_key=FB._apikey;for(var d in e)f.push(encodeURIComponent(d)+'='+encodeURIComponent(e[d]));g+='?'+f.join('&');if(a)c.onload=a;c.src=g;}});

In the summary for the check in on Github, they state, “Add new method – FB.impression – for pixel-based impression tracking.”  So, based on that, it would seem that whether released at F8 or not, there may be an Insights component to this OpenGraph API released.  Insights is the product used by Fan Page owners on Facebook to track activity on Facebook Pages.  Ideally, by enabling the above tags, it could enable website owners to gain added social graph data in addition to impressions, visits, and page views for each user that visits their website, including demographics, ages, nationalities, and even names of users.  That would be a very powerful statistics engine, unrivaled by the likes of Google Analytics and other solutions!

While none of the above work outside the Facebook, Inc. Firewall, it is exciting to know they could be coming.  My expectation is that on or around F8, Facebook should turn on the backend code that powers these, and then, the OpenGraph API will be available for all.  While this stuff is all very powerful, I can’t help but wonder if this is the tip of the iceberg.  None of this encompasses open standards of any kind, yet David Recordon and the Open Standards team at Facebook seem to still be preaching “open”.  I’m assuming there will be something very open and distributed, unreliant on Facebook alone, about all of this coming up this F8.  I can’t wait to see what happens.  Keep watching here, as there is even more out there in the open surrounding the Facebook API that I think is pretty cool.

If you’re coming to F8 on Wednesday, come by and say hi to me!

Facebook’s Like Button for the Whole Internet – Here’s How it Works

Techcrunch today talked about a new “Like Button for the Whole Internet” which Facebook looks to be launching some time soon, and has been tested amongst several developers as they’ve been told.  What they didn’t mention is that you can access the code for this right now in the code to the latest open source Javascript SDK.  While it does not currently work in its current form, it is open for the entire public to see, and has been there for the last few months (along with a few other hints I’ll let you find).

Assuming the source of the new SDK (currently in alpha) remains the same, the XFBML button can be placed on any website on the internet, and it increments the number of likes when a user clicks on it.  By default it increments the likes for the current page, but there appears to also be the ability to specify a “permalink” attribute, along with a URL to another page.  It’s unclear if that will be changeable in the XFBML tag or not.  Also, a required “node_type” attribute that defaults to “page” can be set.  Lastly, an optional “page_url” can be set.  The XFBML tag loads content from /widgets/like.php (attributes of the XFBML tag get passed as attributes in the URL).  That URL appears to be disabled at the moment.

So it looks like the XFBML tag will look something like the following, and it will be part of Facebook’s widgets architecture:

Also of interest, Facebook has an entire tag library devoted to the new tag, like.js.  You can probably gain a little more info from that.  I can’t wait for them to turn on like.php so we can play with this.

My book, FBML Essentials, may just get a lot more interesting as Facebook prepares for their “OpenGraph API”, enabling any website to become its own Facebook Fan Page across the internet.  This is one of many tags I’ve seen that are very interesting – see if you can look through the code and find anything else that looks interesting like this.  I love being a developer. 🙂