May
27

Facebook Open Graph Tutorial: Integrating the "Activity Feed".

Tags:  Facebook Open Graph Tutorial How-to Social Plugin Activity Feed 

This tutorial will show you how to add the Facebook Open Graph "Activity Feed" social plugin to your site with simple copy and paste instructions.
Recommended Resources
JavaScript basics
HTML basics
XFBML basics

Overview.
The Facebook Open Graph "activity feed" plugin can be used to utilize your website to promote posts. It enables you to personalize the user's experience by leveraging either the Facebook Open Graph API or any of your own data driven scripting.

This tutorial is broken down into 3 simple code components:
  » HTML tags
  » JavaScript Facebook Connect API call
  » XFBML "activity feed" plugin

1. HTML opening tag.
Adding these attributes to your opening <html> will allow the Open Graph Protocol to recognize that you will be using its meta tag attributes for posting back to Facebook.

Place the following two xmlns attributes in the opening <html> tag of your document.
<html xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml">


2. JavaScript Facebook Connect API call.
This code includes the JavaScript library to make API calls using XFBML. The only thing you need to edit is the appid parameter.

Place the following directly after the opening <body> tag of your document.
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'app id',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};

(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>


3. XFBML "activity feed" Plugin Integration.
Finally, add the following "activity feed" plugin one line code. There are 7 attributes which you can include to customize the button to your web page:
  » site is the domain of the site your displaying activities for.
  » width is the width of the activity feed.
  » height is the height of the activity feed.
  » header is a boolean value (true/false). This either hides of shows the activity feed header.
  » colorscheme is the color scheme of the activity feed. This can be set to either "light" or "dark".
  » font is the font of the text within the feed. The following fonts are accepted: arial, lucida grande, sego ui, tahoma, trebuchet ms, verdant.
  » border_color is the hex (#000000) color value of the border of the feed.

Place the following anywhere within the <body> of your document.
<fb:activity site="http://www.whitbreaddesign.com" width="250" height="350" header="false" font="verdana" colorscheme = "light" border_color = "#000"></fb:activity>


Conclusion.
And that's all there is to it! Integrate the "activity feed" plugin with all of your posts to see a definite impact on your referrals from Facebook.

More information on Facebook, XFBML and the Open Graph Protocol can be found at http://developers.facebook.com/

Comments

The new Facebook or myspace comfort configurations allow us higher control over who can access our information right down to particular people. The standard establishing for a lot of your information on <a rel="dofollow" rel="nofollow" href="http://www.lovewayz.com/category/facebook-status">Facebook Status</a> or myspace is that only your buddies can see your private information or buddies of buddies.


roxann8 12 months ago

In the more and more widely in tide, domestic youth chase after hold in both hands products constantly upgrade. Sailor's striped shirt, the leap shoes, red scarf, has been you called is domestic "LaoSanYang", watches and bicycles, camera together become more best-known "new three".

replica orologi 3 months ago

Leave a Comment

Name
Email (optional)
Website (optional)
...or login using Facebook to bypass these fields.
Messageusable tags: <b> <i>
Robot?
Loading tweets...
» Quvan Ten on Facebook Connect Logout. 5 months ago
» Pinkesh Soni on Facebook Connect Logout. 8 months ago
» digital recovery on Relevant Anchor Linking for SEO. about 1 year ago
» data recovery program on HTML5/CSS3 Tutorial: Building a Navigation Menu Without Images. about 1 year ago
» Amer Alsharif on Facebook Connect Logout. about 1 year ago
» sms messaging on Relevant Anchor Linking for SEO. about 1 year ago
Site designed, developed and coded by Marc Whitbread ©2011