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

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.

ruby sample.rb

Have fun!