github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

deadprogrammer / frankie

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 121
    • 12
  • Source
  • Commits
  • Network (12)
  • Issues (1)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Easy creation of Facebook applications in Ruby using plugin for Sinatra web framework that integrates with Facebooker gem. — Read more

  cancel

http://www.deadprogrammersociety.com

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Fix for canvas redirect 
jodosha (author)
Thu Sep 03 03:45:14 -0700 2009
commit  0acfaf1f669f24858fa703c249657f7285961d82
tree    4988f610e681c15964ca101afcaef93e94f381d5
parent  13527a067f42d358bdfd95556397f31851a71665
frankie /
name age
history
message
file .DS_Store Sat Apr 12 19:22:56 -0700 2008 Convert Frankie into a gem to work with Sinatra... [Ron Evans]
file .gitignore Sat Apr 12 19:22:56 -0700 2008 Convert Frankie into a gem to work with Sinatra... [Ron Evans]
file CHANGELOG Fri Feb 20 10:37:45 -0800 2009 Update frankie to version 0.3, now works with S... [deadprogrammer]
file LICENSE Sat Apr 12 19:22:56 -0700 2008 Convert Frankie into a gem to work with Sinatra... [Ron Evans]
file Manifest Mon Apr 21 20:54:01 -0700 2008 Update frankie for Sinatra 0.2.2, plus add ssh ... [Ron Evans]
file README.rdoc Fri Feb 20 10:37:45 -0800 2009 Update frankie to version 0.3, now works with S... [deadprogrammer]
file Rakefile Mon Apr 21 21:56:47 -0700 2008 Correct Sinatra gem version for dependency, and... [Ron Evans]
directory bin/ Mon Apr 21 20:54:01 -0700 2008 Update frankie for Sinatra 0.2.2, plus add ssh ... [Ron Evans]
directory lib/ Thu Sep 03 03:45:14 -0700 2009 Fix for canvas redirect [jodosha]
directory test/ Tue Feb 17 16:16:21 -0800 2009 pin it to newer version of Facebooker, updated ... [Michael Jones]
README.rdoc

Frankie

Frankie (facethesinatra.com) is a plugin for the Sinatra web framework (sinatrarb.com) that allows you to easily create a Facebook application by using the Facebooker gem.

Written by Ron Evans (www.deadprogrammersociety.com)

Based on merb_facebooker (github.com/vanpelt/merb_facebooker) by Chris Van Pelt, which was based on the Rails classes in Facebooker (facebooker.rubyforge.org/) by Mike Mangino, Shane Vitarana, & Chad Fowler

2/20/2009 - Now updated to Sinatra 0.9 and facebooker thanks to mjfreshyfresh.

Thanks, everyone!

Here is a very simple example application:

        require 'rubygems'
        require 'frankie'

        configure do
          set_option :sessions, true
          load_facebook_config "./config/facebooker.yml", Sinatra.env
        end

        ## facebooker helpers
        before do
          ensure_authenticated_to_facebook
          ensure_application_is_installed_by_facebook_user
        end

        ## the site
        get '/' do
          body "<h1>Hello #{session[:facebook_session].user.name} and welcome to frankie!</h1>"
        end

How to use frankie

  • Install the frankie gem (which will install both Sinatra and Facebooker if you do not already have them)
          sudo gem install frankie
    
  • Create the application directories for your new app
          mkdir myapp
          cd myapp
          mkdir config
    
  • Put your facebooker.yml file into the /myapp/config directory, and set the values to your information. Here is a simple example of the file:
          development:
           api_key: apikeyhere
           secret_key: secretkeyhere
           canvas_page_name: yourcanvashere
           callback_url: http://localhost:4567
          test:
           api_key: apikeyhere
           secret_key: secretkeyhere
           canvas_page_name: yourcanvashere
           callback_url: http://localhost:4567
          production:
           api_key: apikeyhere
           secret_key: secretkeyhere
           canvas_page_name: yourcanvashere
           callback_url: http://yourrealserver.com
    
  • Make sure you have setup your Facebook application on the facebook site. Google "setup new facebook application" if you are unsure how to do this. I recommend starting with an IFrame application. A more advanced and cooler approach uses a tunneling script, which is included with Frankie. You do need to have "autossh" installed in order to use it, as well as a publicly addressable server. From a command prompt type tunnel <host> <remote_port> <local_port> like this:
          tunnel app.myhost.com 10000 4567
    

You will also need to make sure your server’s /etc/ssh/sshd_config contains the following line:

        GatewayPorts clientspecified

Thanks to the many people like Evan Weaver, Blake Mizerany, and whoever else that have provided the code used in this tunneling script.

  • Create your application, based on the sample above, and then run it:

ruby sample.rb

  • Test your app by going to apps.facebook.com/yourappname

Have fun!

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server