Your SlideShare is downloading. ×
  • Like
Facebook mit Rails und Facebooker
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Facebook mit Rails und Facebooker

  • 1,455 views
Published

a rather rough version of a presentation on facebook and how to write fb-apps in rails.

a rather rough version of a presentation on facebook and how to write fb-apps in rails.

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,455
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
22
Comments
0
Likes
1

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. Rails vs. Facebooker Facebook-Apps mit Facebooker Jan Krutisch <jan.krutisch@mindmatters.de> 10. Juni 2009 Rails Usergroup Hamburg Donnerstag, 11. Juni 2009
  • 2. Facebook you say? Donnerstag, 11. Juni 2009
  • 3. 200 Gazillionen Benutzer Donnerstag, 11. Juni 2009
  • 4. (pro Tag) Donnerstag, 11. Juni 2009
  • 5. (ungefähr) Donnerstag, 11. Juni 2009
  • 6. verdammt viele Donnerstag, 11. Juni 2009
  • 7. potentielle Kunden Donnerstag, 11. Juni 2009
  • 8. für was? Donnerstag, 11. Juni 2009
  • 9. for great justice Donnerstag, 11. Juni 2009
  • 10. Step 3: Profit Donnerstag, 11. Juni 2009
  • 11. Virales Wachstum und so... Donnerstag, 11. Juni 2009
  • 12. Donnerstag, 11. Juni 2009
  • 13. Glaubt mir! Donnerstag, 11. Juni 2009
  • 14. anyway Donnerstag, 11. Juni 2009
  • 15. facebook application? Donnerstag, 11. Juni 2009
  • 16. Integrationspunkte Donnerstag, 11. Juni 2009
  • 17. Canvas Donnerstag, 11. Juni 2009
  • 18. Donnerstag, 11. Juni 2009
  • 19. Donnerstag, 11. Juni 2009
  • 20. • App in App (Proxy bzw. iFrame) • HTML plus FBML • Zusätzliche Parameter, Header etc. Donnerstag, 11. Juni 2009
  • 21. FBML ZOMG WTF? Donnerstag, 11. Juni 2009
  • 22. Face Book Markup Language Donnerstag, 11. Juni 2009
  • 23. <fb:fbml> <fb:header>dings</fb:header> <%- fb_tabs do -%> <%= yield :tabs %> <%- end -%> <fb:add-section-button section=quot;profilequot; /> <%= yield %> </fb:fbml> Donnerstag, 11. Juni 2009
  • 24. loads of tags Donnerstag, 11. Juni 2009
  • 25. BML hp/F ind ex.p m/ oo k.co rs.f aceb eve lope //w iki.d http: Text Donnerstag, 11. Juni 2009
  • 26. • Daten-Integration • Cache-Hilfen • Forms • Styling • Visibility Donnerstag, 11. Juni 2009
  • 27. API Donnerstag, 11. Juni 2009
  • 28. (out of scope) Donnerstag, 11. Juni 2009
  • 29. Profil-Widgets pushen Donnerstag, 11. Juni 2009
  • 30. Donnerstag, 11. Juni 2009
  • 31. (Auch FBML) Donnerstag, 11. Juni 2009
  • 32. Notifications Donnerstag, 11. Juni 2009
  • 33. Donnerstag, 11. Juni 2009
  • 34. Publisher Donnerstag, 11. Juni 2009
  • 35. Donnerstag, 11. Juni 2009
  • 36. Facebook Connect Donnerstag, 11. Juni 2009
  • 37. (Think OAuth) Donnerstag, 11. Juni 2009
  • 38. Weitere Technologien Donnerstag, 11. Juni 2009
  • 39. FBJS Donnerstag, 11. Juni 2009
  • 40. Face Book Just Sucks Donnerstag, 11. Juni 2009
  • 41. Donnerstag, 11. Juni 2009
  • 42. <%= image_tag image.small_url, :id => quot;gallery_image_#{image.id}quot;, :class => quot;gallery-imagequot;, :onclick => quot;setImage(#{image.id});return false;quot; %> Donnerstag, 11. Juni 2009
  • 43. <img alt=quot;101_21480322_originalquot; class=quot;gallery- imagequot; id=quot;app208488715334_gallery_image_29quot; onclick=quot;fbjs_sandbox.instances.a208488715334.bo otstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instanc e(this, 208488715334),function(a208488715334_event) {a208488715334_setImage(29);return false;}, 208488715334],new fbjs_event(event));return true;quot; src=quot;http://s3.amazonaws.com/com.dpa- info.widget.staging/ 101_21480322_original.small-1-1-200-126-0-582-45 6.jpgquot; fbcontext=quot;fa3facfe268fquot;> Donnerstag, 11. Juni 2009
  • 44. Aber wie? Donnerstag, 11. Juni 2009
  • 45. Facebooker Donnerstag, 11. Juni 2009
  • 46. Chad Fowler Donnerstag, 11. Juni 2009
  • 47. Mike Mangino Donnerstag, 11. Juni 2009
  • 48. Donnerstag, 11. Juni 2009
  • 49. • Sehr coole API-Umsetzung • before_filter f. Auth etc. • Fast alle APIs abgedeckt • Publisher (wie Mailer) f. Notifications, Profile, Profile-Publisher • FBML-Helper Donnerstag, 11. Juni 2009
  • 50. Configure Donnerstag, 11. Juni 2009
  • 51. Donnerstag, 11. Juni 2009
  • 52. Donnerstag, 11. Juni 2009
  • 53. development: api_key: --------------------------------- secret_key: ---------------------------------- canvas_page_name: example callback_url: http://example:4007 pretty_errors: true set_asset_host_to_callback_url: true tunnel: public_host_username: johndoe public_host: example.com public_port: 4007 local_port: 3000 server_alive_interval: 0 test: api_key: --------------------------------- secret_key: ---------------------------------- canvas_page_name: example callback_url: http://example:4007 pretty_errors: true set_asset_host_to_callback_url: true tunnel: public_host_username: johndoe public_host: example.com public_port: 4007 local_port: 3000 server_alive_interval: 0 Donnerstag, 11. Juni 2009
  • 54. rake facebooker:tunnel:start Donnerstag, 11. Juni 2009
  • 55. ssh -R :4007:localhost:3000 johndoe@example.com sleep 999999 Donnerstag, 11. Juni 2009
  • 56. #/etc/ssh/sshd_config GatewayPorts clientspecified Donnerstag, 11. Juni 2009
  • 57. $ /script/server Donnerstag, 11. Juni 2009
  • 58. client browser facebook example.com dev machine Donnerstag, 11. Juni 2009
  • 59. CodePorn.random Donnerstag, 11. Juni 2009
  • 60. ApplicatioController Donnerstag, 11. Juni 2009
  • 61. # Filters added to this controller apply to all controllers in the application. # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base include ExceptionNotifiable helper :all # include all helpers, all the time protect_from_forgery # See ActionController::RequestForgeryProtection for d... helper_attr :current_user attr_accessor :current_user ensure_authenticated_to_facebook before_filter :create_facebook_session, :set_current_user # Scrub sensitive parameters from your log # filter_parameter_logging :password def set_current_user self.current_user = User.for(facebook_session.user.to_i, facebook_session) end end Donnerstag, 11. Juni 2009
  • 62. <fb:fbml> <style type=quot;text/cssquot; media=quot;screenquot;> ul.image-list li h2 { margin-bottom: 5px; } .single-image { width:760px; text-align:center; margin-top:10px; } .single-image h2 { margin-bottom: 5px; } </style> <fb:header>dpa-info.com galerie</fb:header> <%- fb_tabs do -%> <%= yield :tabs %> <%- end -%> <fb:add-section-button section=quot;profilequot; /> <%= yield %> </fb:fbml> Donnerstag, 11. Juni 2009
  • 63. application.fbml.erb Donnerstag, 11. Juni 2009
  • 64. <%- content_for :tabs do -%> <%= fb_tab_item 'Gallery', root_url, :selected => true %> <%= fb_tab_item 'Invite your friends', new_invitation_url %> <%- end -%> Donnerstag, 11. Juni 2009
  • 65. Profile Template Donnerstag, 11. Juni 2009
  • 66. <%- @assigns[:images].each do |image| -%> <%= link_to image_tag(image.small_url, :title => h(image.title), :alt => h(image.title)), root_url %> <%- end -%> <%= link_to quot;Mehr Bilder...quot;, gallery_url %> Donnerstag, 11. Juni 2009
  • 67. Publisher Donnerstag, 11. Juni 2009
  • 68. class GalleryPublisher < Facebooker::Rails::Publisher def image_feed_template app_link = link_to(quot;Mehr Photos...quot;,root_url) one_line_story_template quot;{*actor*} mag das Photo '{*image_title*}' #{app_link}quot; short_story_template quot;{*actor*} mag das Photo '{*image_title*}' aus der dpa- Galeriequot;, quot;#{app_link}quot; end def image_feed(user, image) send_as :user_action from user data :image_title => image.title, :images=>[image(image.small_url,root_url)] end def profile_update(user) send_as :profile recipients user @images = DailyImage.latest.all(:limit => 10) profile render(:partial => quot;profilequot;, :assigns => {:images => @images} ) profile_main render(:partial => quot;profile_narrowquot;, :assigns => {:images => @images[0..3]} ) end end Donnerstag, 11. Juni 2009
  • 69. ProfilePublisher Donnerstag, 11. Juni 2009
  • 70. class ProfilePublisherController < ApplicationController skip_before_filter :ensure_authenticated_to_facebook def index if current_user.nil? and facebook_params[:user] self.current_user = User.for(facebook_params[:user]) end if wants_interface? @images = DailyImage.latest.all(:limit => 10) render_publisher_interface(render_to_string(:partial=>quot;formquot;, :assigns => {:images => @images})) else @image = DailyImage.find(params[:app_params][:id]) render_publisher_response(GalleryPublisher.create_image_feed(current_user, @image)) end end end Donnerstag, 11. Juni 2009
  • 71. some more code... Donnerstag, 11. Juni 2009
  • 72. fin Donnerstag, 11. Juni 2009