WELCOME  TO  RUBY ON RAILS  DEVELOPERS
An introduction to Facebook Connect Nyros Facebook Developer Garage, May 29 th  2010
Requirements for facebook integration <ul><li>Facebooker Gem </li></ul><ul><li>Facebooker Plugin </li></ul><ul><li>Faceboo...
<ul><li>Introduction </li></ul><ul><li>Uses in real time </li></ul><ul><li>Implementation & Integration with Rails App </l...
Facebook Connect - Introduction <ul><li>What Facebook Connect does: </li></ul><ul><li>Allow your friend network informatio...
<ul><li>Traffic </li></ul><ul><li>Enable over 300MM Facebook users to share your content with their friends on Facebook </...
Use in real time Scribd  is a document-sharing website
 
Use in real time
Use in real time
News feed in our FB friends wall
Implementation & Integration with Rails App <ul><li>Create Rails Application </li></ul><ul><li>c: > rails connect_facebook...
Implementation & Integration with Rails App <ul><li>Steps for create facebook application </li></ul><ul><li>http://www.fac...
 
 
 
Take a note of the api_key and secret and add these to config/facebooker.yml
development: api_key: 23ad2f3a4cf6f235b2249dd0138c2913 secret_key: d3570fc4434b5a4ad9e1fc0f29e991c3 canvas_page_name: call...
<ul><li>Javascript tags include at application layout </li></ul><%= javascript_tag &quot;window.xd_receiver_location = '#{...
Some Connect code: <fb:login-button>  </fb:login-button> <script src=&quot;http://static.ak.connect.facebook.com/js/api_li...
<ul><li>c: > ruby/script/generate xd_receiver </li></ul><ul><li>xd_receiver is a cross-domain receiver file </li></ul>Two ...
<ul><li>Create controller </li></ul><ul><li>c: > ruby script/generate controller fb_connect </li></ul><ul><li>def authenti...
Enter here out facebook login details
A Facebook styled dialogue box lets the user know what’s going on
 
<ul><li>What you can do when you’re “Connect”ed: </li></ul><ul><li>Display information from Facebook profiles on your own ...
Facebook Connect – How it works <ul><li>Quick tech intro: </li></ul><ul><li>Uses an evolved version of the JavaScript clie...
<ul><li>What you can’t do: </li></ul><ul><li>Publish stories to a friends newsfeed, only to the current user’s </li></ul><...
Facebook Connect – Disadvantages There are disadvantages to Facebook Connect…
Facebook Connect – Disadvantages <ul><li>It’s all in JavaScript: </li></ul><ul><li>Not always the most manageable code </l...
Facebook Connect – Disadvantages <ul><li>It’s not a treasure-trove of new user details: </li></ul><ul><li>Can’t access any...
Facebook Connect – The future Thanks Ratnam Raju,  [email_address]
Upcoming SlideShare
Loading in …5
×

Connect with Facebook to Rails Application By Nyros Developer

5,447 views

Published on

Connect with Facebook to Rails Application

1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
5,447
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
155
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Connect with Facebook to Rails Application By Nyros Developer

  1. 1. WELCOME TO RUBY ON RAILS DEVELOPERS
  2. 2. An introduction to Facebook Connect Nyros Facebook Developer Garage, May 29 th 2010
  3. 3. Requirements for facebook integration <ul><li>Facebooker Gem </li></ul><ul><li>Facebooker Plugin </li></ul><ul><li>Facebook Login Details </li></ul><ul><li>Facebook Developer Application </li></ul>
  4. 4. <ul><li>Introduction </li></ul><ul><li>Uses in real time </li></ul><ul><li>Implementation & Integration with Rails App </li></ul>
  5. 5. Facebook Connect - Introduction <ul><li>What Facebook Connect does: </li></ul><ul><li>Allow your friend network information to be brought to external websites </li></ul><ul><li>Allow external website activity to be brought into Facebook </li></ul><ul><li>Both aspects top priority for Facebook. </li></ul>
  6. 6. <ul><li>Traffic </li></ul><ul><li>Enable over 300MM Facebook users to share your content with their friends on Facebook </li></ul><ul><li>Engagement </li></ul><ul><li>Users can immediately find their friends and engage(add as friend). </li></ul><ul><li>Revenue </li></ul><ul><li>Boost your revenue. Facebook Connect helps you grow revenue by increasing traffic and user engagement. In addition, better targeting capabilities can improve monetization. </li></ul>Facebook Connect - Introduction
  7. 7. Use in real time Scribd is a document-sharing website
  8. 9. Use in real time
  9. 10. Use in real time
  10. 11. News feed in our FB friends wall
  11. 12. Implementation & Integration with Rails App <ul><li>Create Rails Application </li></ul><ul><li>c: > rails connect_facebook </li></ul><ul><li>c: > gem install facebooker </li></ul><ul><li>c: >ruby script/plugin install git://github.com/mmangino/facebooker.git </li></ul><ul><li>or download from github http://github.com/mmangino/facebooker </li></ul><ul><li>Plugin placed at </li></ul><ul><li>connect_facebookvendorplugins </li></ul>
  12. 13. Implementation & Integration with Rails App <ul><li>Steps for create facebook application </li></ul><ul><li>http://www.facebook.com/developers/createapp.php </li></ul>
  13. 17. Take a note of the api_key and secret and add these to config/facebooker.yml
  14. 18. development: api_key: 23ad2f3a4cf6f235b2249dd0138c2913 secret_key: d3570fc4434b5a4ad9e1fc0f29e991c3 canvas_page_name: callback_url: http://localhost:3000/ pretty_errors: true set_asset_host_to_callback_url: true tunnel: public_host_username: public_host: public_port: 4007 local_port: 3000 add these api and secret keys to config/facebooker.yml
  15. 19. <ul><li>Javascript tags include at application layout </li></ul><%= javascript_tag &quot;window.xd_receiver_location = '#{ENV['XD_RECEIVER_LOCATION']}';&quot; %> <%= javascript_include_tag 'facebook_require' %> <%= javascript_include_tag 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php' %> or register with Facebook connect <fb:login-button onclick='facebook_button_onclick()'></fb:login-button>
  16. 20. Some Connect code: <fb:login-button> </fb:login-button> <script src=&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php&quot; type=&quot;text/javascript&quot;></script> This loads in the JavaScript library which renders the login button
  17. 21. <ul><li>c: > ruby/script/generate xd_receiver </li></ul><ul><li>xd_receiver is a cross-domain receiver file </li></ul>Two different methods for login, in this implementation
  18. 22. <ul><li>Create controller </li></ul><ul><li>c: > ruby script/generate controller fb_connect </li></ul><ul><li>def authenticate </li></ul><ul><li>set_facebook_session </li></ul><ul><li>@facebook_session = Facebooker::Session.create(Facebooker.api_key, Facebooker.secret_key) </li></ul><ul><li>logger.debug &quot;facebook session in authenticate: #{facebook_session.inspect}&quot; </li></ul><ul><li>#render :text=>set_facebook_session and return </li></ul><ul><li>redirect_to @facebook_session.login_url </li></ul><ul><li>end </li></ul>
  19. 23. Enter here out facebook login details
  20. 24. A Facebook styled dialogue box lets the user know what’s going on
  21. 26. <ul><li>What you can do when you’re “Connect”ed: </li></ul><ul><li>Display information from Facebook profiles on your own site </li></ul><ul><li>Publish stories to Facebook from your site </li></ul><ul><li>Re-create your users’ social graphs </li></ul>
  22. 27. Facebook Connect – How it works <ul><li>Quick tech intro: </li></ul><ul><li>Uses an evolved version of the JavaScript client library: </li></ul><ul><li>Use FBML within your standard HTML. (They call this XFBML.) </li></ul><ul><li>Make standard Facebook API calls within the JavaScript library </li></ul><ul><li>Facebook’s JavaScript XFBML library populates FBML tags on your site with profile data </li></ul>
  23. 28. <ul><li>What you can’t do: </li></ul><ul><li>Publish stories to a friends newsfeed, only to the current user’s </li></ul><ul><li>Update any profile box except that of the current user </li></ul>
  24. 29. Facebook Connect – Disadvantages There are disadvantages to Facebook Connect…
  25. 30. Facebook Connect – Disadvantages <ul><li>It’s all in JavaScript: </li></ul><ul><li>Not always the most manageable code </li></ul><ul><li>Takes some lateral thinking to hook up with your site’s databases </li></ul><ul><li>No SEO benefits </li></ul><ul><li>Poor accessibility (JavaScript disabled = Facebook Connect doesn’t work) </li></ul>
  26. 31. Facebook Connect – Disadvantages <ul><li>It’s not a treasure-trove of new user details: </li></ul><ul><li>Can’t access any more friend details than if a user adds an application i.e. no access to e-mail addresses </li></ul><ul><li>Facebook intends privacy settings to be dynamic, therefore changes in Facebook settings may affect your site </li></ul><ul><li>You don’t own the data </li></ul>
  27. 32. Facebook Connect – The future Thanks Ratnam Raju, [email_address]

×