The developer release is now available:
script/plugin install http://facetime.googlecode.com/svn/trunk/facetimeCheck out the project wiki for instructions and documentation.
If you're interested in participating or providing feedback, stop by
... [More]
the Facetime group or file a ticket using the issue tracker.
Improved test coverage, sample code and documentation, and any feedback or thoughts you may have, would be especially helpful in bringing the library to a production-ready level.
Facetime's aim is to be a Facebook interface that’s borderline indisguishable from other Rails code — meaning its understandable, enjoyable, and doesn’t require hours of pouring through Facebook’s API documentation.
Simple, Powerful FeaturesActiveRecord Associations Dynamic finders Automatic typecasting (coming soon) # 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'
Easier UpdatesFacetime employs an API template for updates, which is easily configurable to support any API request/template combination. Here's a few that are predefined:
# sample method/template # Facebook API call
update_facebook 'wide.profile' #=> profile.setFBML
update_facebook 'application.fbjs' #=> fbml.setRefHandle
update_facebook 'http://mysite.com/image.jpg' #=> fbml.refreshImgSrc
update_facebook 'http://mysite.com/mycontent' #=> fbml.refreshRefUrl
Flexible, Low Level InterfaceWhile we're working to make it unnecessary to directly query Facebook, our low-level interface is available when you need it. Give us the method and pass a Hash object, and we'll take care of the details.
api_params = {:uids => 33806641,
:session_key => a_session_key,
:fields => ['first_name', 'last_name'] }
user = Facetime::API::Users.get_info(api_params)
# user #=>
# [{'first_name' => "Eric", 'last_name' => "Chapweske", 'uid' => "33806641"}]
Simple InstallationFacetime assumes that you have a model named User with the attributes :facebook_session_key and :facebook_uid. However, this is customizable. Refer to the SetupAndInstallationGuide for detailed installation instructions.
Quick install
This covers adding migrations and configuring Facetime, your model, and controller. Install the library from your application directory by running:
script/plugin install http://facetime.googlecode.com/svn/trunk/facetime Edit app/config/facetime/facebook.yml to include your application and developer information. Run a migration on your user model: class AddFacetimeAccountToUsers < ActiveRecord::Migration
add_column :users, :facebook_session_key, :string
add_column :users, :facebook_uid, :integer
endIn your user model, add the line has_facebook_account class User < ActiveRecord::Base
has_facebook_account
endIn your controller, add the line facebook_interface class FacebookController < ApplicationController
facebook_interface
endYour application is now ready to go. For sample code, refer to the UsageGuide. [Less]