Facetime plugin

Plugin details

Facetime is an interface for Facebook's API that aims to be borderline indisguishable from other Rails code meaning its understandable, enjoyable, and doesn't require hours of pouring through Facebook's API documentation

Simple, Powerful Features include:

1. ActiveRecord Associations
2. Dynamic finders
3. Automatic typecasting

Websitehttp://code.google.com/p/facetime/ Repositoryhttp://facetime.googlecode.com/svn/trunk/facetime Author Eric Chapweske Tags Facebook LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://facetime.googlecode.com/svn/trunk/facetime

Add your Facebook developer API keys to config/facetime/facebook.yml Add 'facebook_session_key' and 'facebook_uid' columns to the model

In the model these columns were added to, add the following code:
This sample assumes the model is named user, but it will work with any model.

class User < ActiveRecord::Base
  include Facetime::FacebookAssociations
  
  def facebook_api_params
    @facebook_api_params ||= { :session_key => facebook_session_key }
  end
  
end



The above code ties in the User model to the Facebook API, allowing for the following:

current_user = User.find :first



# See if the user has the application installed

current_user.facebook.is_app_user? #=> true



# Find the user's facebook album named 'Halloween'

recommended_album   = current_user.facebook.albums.find_by_name 'Halloween'



# Retrieves all the photos in the album

@recommended_photos = recommended_album.photos



# Publishes to the user's activity feed using the 'recommended_photos' template
# This is configurable to use any template/API call

update_facebook 'recommended_photos.feed'

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, 3 months ago