Giter VIP home page Giter VIP logo

frankie's Introduction

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.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: localhost:4567 test: api_key: apikeyhere secret_key: secretkeyhere canvas_page_name: yourcanvashere

callback_url: localhost:4567 production: api_key: apikeyhere secret_key: secretkeyhere canvas_page_name: yourcanvashere

callback_url: 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

Have fun!

frankie's People

Contributors

fravic avatar deadprogram avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.