Your SlideShare is downloading. ×
0
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
So you want to build a Facebook app
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

So you want to build a Facebook app

7,349

Published on

Here's my 50-foot view of building a Facebook application on Rails. Rails itself is not part of the presentation - you can check out one of my available slides for that. Target: non-techies and people …

Here's my 50-foot view of building a Facebook application on Rails. Rails itself is not part of the presentation - you can check out one of my available slides for that. Target: non-techies and people who just want to find out the Facebook API architecture. I wished I could've put more content, like y'know, ACTUAL CODE???

Published in: Technology
8 Comments
27 Likes
Statistics
Notes
  • nice application check my sites www.ethicalhackrz.tk and www.hackthecrack.tk
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Great stuff, keep it up kamal.

    Azuyo.com Inc
    http://www.azuyo.com
    We develop great Facebook, Mashup, Mobile Apps!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • I am trying to build an online store browser for my website - http://www.detoxdietabc.com

    Can you help me out? I am having problems with the FBML routines...
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • How would i use this to an adult site? Example: http://www.penisenlargerblog.com
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • asdfasf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
7,349
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
471
Comments
8
Likes
27
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. So you want to build a Facebook app Facebook Developer Garage Kuala Lumpur Kamal Fariz, RSB
  2. Basic Ingredients
  3. http://www.facebook.com/apps/application.php?id=2345053339
  4. Ruby on Rails
  5. rfacebook gem
  6. STEP 1 Setup a new application
  7. STEP 2 Create a Rails app
  8. A full-stack framework for developing database-backed web applications according to the Model-View-Controller pattern.
  9. A full-stack framework for developing database-backed web applications according to the Model-View-Controller A bunch of stuff that makes web developers happy! pattern. - David Heinemeier Hansson http://flickr.com/photos/pragdave/174964316/
  10. MacBook-Pro:~ kamal$ rails super_gifts
  11. MacBook-Pro:~ kamal$ rails super_gifts create create app/controllers create app/controllers/application.rb create app/helpers/application_helper.rb create test/test_helper.rb create config/database.yml create config/routes.rb ... create public/images/rails.png create public/javascripts/prototype.js create public/javascripts/effects.js create public/javascripts/dragdrop.js create public/javascripts/controls.js create public/javascripts/application.js create doc/README_FOR_APP create log/server.log create log/production.log create log/development.log create log/test.log MacBook-Pro:~ kamal$
  12. MacBook-Pro:~ kamal$ gem install rfacebook
  13. MacBook-Pro:~ kamal$ gem install rfacebook Successfully installed rfacebook-0.9.8 1 gem installed Installing ri documentation for rfacebook-0.9.8... Installing RDoc documentation for rfacebook-0.9.8... MacBook-Pro:~ kamal$
  14. MacBook-Pro:~ kamal$ gem install rfacebook Successfully installed rfacebook-0.9.8 1 gem installed Installing ri documentation for rfacebook-0.9.8... Installing RDoc documentation for rfacebook-0.9.8... MacBook-Pro:~ kamal$ cd super_gifts/
  15. MacBook-Pro:~ kamal$ gem install rfacebook Successfully installed rfacebook-0.9.8 1 gem installed Installing ri documentation for rfacebook-0.9.8... Installing RDoc documentation for rfacebook-0.9.8... MacBook-Pro:~ kamal$ cd super_gifts/ MacBook-Pro:super_gifts kamal$
  16. MacBook-Pro:~ kamal$ gem install rfacebook Successfully installed rfacebook-0.9.8 1 gem installed Installing ri documentation for rfacebook-0.9.8... Installing RDoc documentation for rfacebook-0.9.8... MacBook-Pro:~ kamal$ cd super_gifts/ MacBook-Pro:super_gifts kamal$ ./script/plugin install
  17. MacBook-Pro:~ kamal$ gem install rfacebook Successfully installed rfacebook-0.9.8 1 gem installed Installing ri documentation for rfacebook-0.9.8... Installing RDoc documentation for rfacebook-0.9.8... MacBook-Pro:~ kamal$ cd super_gifts/ MacBook-Pro:super_gifts kamal$ ./script/plugin install http://rfacebook.rubyforge.org/svn/trunk/rfacebook/
  18. MacBook-Pro:~ kamal$ gem install rfacebook Successfully installed rfacebook-0.9.8 1 gem installed Installing ri documentation for rfacebook-0.9.8... Installing RDoc documentation for rfacebook-0.9.8... MacBook-Pro:~ kamal$ cd super_gifts/ MacBook-Pro:super_gifts kamal$ ./script/plugin install http://rfacebook.rubyforge.org/svn/trunk/rfacebook/ + ./README + ./Rakefile + ./lib/facebook_desktop_session.rb + ./lib/facebook_session.rb + ./lib/facebook_web_session.rb ... + ./test/facebook_web_session_test.rb + ./test/test_helper.rb MacBook-Pro:super_gifts kamal$
  19. MacBook-Pro:super_gifts kamal$ rake facebook:setup
  20. MacBook-Pro:super_gifts kamal$ rake facebook:setup (in /Users/kamal/super_gifts) ====================================================== Setting up RFacebook on Rails Plugin [1] Created config/facebook.yml <-- BE SURE TO CHANGE THE API KEY AND SECRET Done. ====================================================== MacBook-Pro:super_gifts kamal$
  21. development: key: YOUR_API_KEY_HERE secret: YOUR_API_SECRET_HERE canvas_path: /yourAppName/ callback_path: /path/to/your/callback/ tunnel: username: yourLoginName host: www.yourexternaldomain.com port: 1234 local_port: 5678 config/facebook.yml
  22. development: key: c6578c8b63873881caad22fccfe2715b secret: 6b3f1f580409cd487f431e22923f00ad canvas_path: /super_gifts/ callback_path: / tunnel: username: kamal host: deploy.ror.com.my port: 8080 local_port: 3000 config/facebook.yml
  23. MacBook-Pro:super_gifts kamal$ rake facebook:tunnel:start
  24. MacBook-Pro:super_gifts kamal$ rake facebook:tunnel:start (in /Users/kamal/super_gifts) ====================================================== Tunneling deploy.ror.com.my:8080 to 0.0.0.0:3000 NOTES: * ensure that you have Rails running on your local machine at port 3000 * once logged in to the tunnel, you can visit http://deploy.ror.com.my:8080 to view your site * use ctrl-c to quit the tunnel * if you have problems creating the tunnel, you may need to add the following to /etc/ssh/sshd_config on your server: GatewayPorts clientspecified * if you have problems with deploy.ror.com.my timing out your ssh connection, add the following lines to your '~/.ssh/config' file: Host deploy.ror.com.my ServerAliveInterval 120 ======================================================
  25. MacBook-Pro:super_gifts kamal$ ./script/server => Booting WEBrick... => Rails application started on http://0.0.0.0:3000 => Ctrl-C to shutdown server; call with --help for options [2008-03-14 16:38:07] INFO WEBrick 1.3.1 [2008-03-14 16:38:07] INFO ruby 1.8.6 (2007-09-23) [i686-darwin9.0.0] [2008-03-14 16:38:07] INFO WEBrick::HTTPServer#start: pid=68088 port=3000
  26. What happens when you access an app?
  27. http://apps.facebook.com/super_gifts
  28. MacBook-Pro:super_gifts kamal$ ./script/server => Booting WEBrick... => Rails application started on http://0.0.0.0:3000 => Ctrl-C to shutdown server; call with --help for options [2008-03-14 16:38:07] INFO WEBrick 1.3.1 [2008-03-14 16:38:07] INFO ruby 1.8.6 (2007-09-23) [i686- darwin9.0.0] [2008-03-14 16:38:07] INFO WEBrick::HTTPServer#start: pid=68088 port=3000
  29. MacBook-Pro:super_gifts kamal$ ./script/server => Booting WEBrick... => Rails application started on http://0.0.0.0:3000 => Ctrl-C to shutdown server; call with --help for options [2008-03-14 16:38:07] INFO WEBrick 1.3.1 [2008-03-14 16:38:07] INFO ruby 1.8.6 (2007-09-23) [i686- darwin9.0.0] [2008-03-14 16:38:07] INFO WEBrick::HTTPServer#start: pid=68088 port=3000
  30. Making things look right
  31. FBML
  32. <fb:name uid=quot;508258787quot; /> => you
  33. <fb:name uid=quot;508258787quot; /> => you <fb:name uid=quot;508258787quot; capitalize=quot;truequot; /> => You
  34. <fb:name uid=quot;508258787quot; /> => you <fb:name uid=quot;508258787quot; capitalize=quot;truequot; /> => You <fb:name uid=quot;508258787quot; possessive=quot;truequot; /> => Your
  35. <fb:name uid=quot;508258787quot; /> => you <fb:name uid=quot;508258787quot; capitalize=quot;truequot; /> => You <fb:name uid=quot;508258787quot; possessive=quot;truequot; /> => Your <fb:name uid=quot;508258787quot; reflexive=quot;truequot; /> => Yourself
  36. <fb:name uid=quot;508258787quot; /> => you <fb:name uid=quot;508258787quot; capitalize=quot;truequot; /> => You <fb:name uid=quot;508258787quot; possessive=quot;truequot; /> => Your <fb:name uid=quot;508258787quot; reflexive=quot;truequot; /> => Yourself <fb:name uid=quot;508258787quot; useyou=quot;falsequot; /> => Kamal Fariz Mahyuddin
  37. <fb:name uid=quot;508258787quot; /> => you <fb:name uid=quot;508258787quot; capitalize=quot;truequot; /> => You <fb:name uid=quot;508258787quot; possessive=quot;truequot; /> => Your <fb:name uid=quot;508258787quot; reflexive=quot;truequot; /> => Yourself <fb:name uid=quot;508258787quot; useyou=quot;falsequot; /> => Kamal Fariz Mahyuddin <fb:name uid=quot;510442171quot; /> => Daniel CerVentus
  38. <fb:name uid=quot;508258787quot; /> => you <fb:name uid=quot;508258787quot; capitalize=quot;truequot; /> => You <fb:name uid=quot;508258787quot; possessive=quot;truequot; /> => Your <fb:name uid=quot;508258787quot; reflexive=quot;truequot; /> => Yourself <fb:name uid=quot;508258787quot; useyou=quot;falsequot; /> => Kamal Fariz Mahyuddin <fb:name uid=quot;510442171quot; /> => Daniel CerVentus <fb:name uid=quot;510442171quot; firstnameonly=quot;truequot; /> => Daniel
  39. <fb:user-table cols=quot;3quot;> <fb:user-item uid=quot;508258787quot; /> <fb:user-item uid=quot;510442171quot; /> <fb:user-item uid=quot;780410586quot; /> <fb:user-item uid=quot;544248752quot; /> <fb:user-item uid=quot;543101914quot; /> </fb:user-table>
  40. <fb:comments xid=quot;super_gift_commentsquot; canpost=quot;truequot; returnurl=quot;http://apps.facebook.com/super_giftsquot;> <fb:title>The Wall</fb:title> </fb:comments>
  41. FBML Test Console http://developers.facebook.com/tools.php?fbml
  42. Making things act right
  43. API
  44. fbsession.friends_get <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?> <friends_get_response ... list=quot;truequot;> <uid>400156</uid> <uid>1906543</uid> <uid>5404778</uid> <uid>8602139</uid> ... <uid>5404778</uid> <uid>8602139</uid> </friends_get_response>
  45. fbsession.notifications_send(:to_ids => ['400156', '1906543'], :notification => message)
  46. API Test Console http://developers.facebook.com/tools.php?api
  47. STEP 3 PROFIT!!!111!!!1!!
  48. Resources
  49. Hosting - Joyent Accelerator for Facebook Developers http://www.joyent.com/developers/facebook/ Facebook Developers Wiki http://wiki.developers.facebook.com/ FBML Test Console http://developers.facebook.com/tools.php?fbml API Test Console http://developers.facebook.com/tools.php?api Ruby on Rails http://www.rubyonrails.org/ rfacebook http://rfacebook.rubyforge.org/ facebooker http://facebooker.rubyforge.org/
  50. Malaysia.rb Malaysia Ruby Brigade
  51. 106 people in Google Groups 53 people in Facebook Group
  52. Meets every third Thursday of the month
  53. Malaysia.rb 3rd Meetup July 2007
  54. http://groups.google.com/group/malaysia-rb

×