Facetime plugin
Plugin details
Documentation
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 documentationEdit plugin | Back in time (1 older version) | Last edited by: scott, 3 months ago

