Class: Raicebook::FbEvents

Inherits:
Base
  • Object
show all
Defined in:
lib/raicebook/fb_events.rb

Class Method Summary collapse

Methods inherited from Base

get_app_acc_token

Class Method Details

.all(options = {}) ⇒ Object

You can give an app_id or the current logged user “me” example : FbEvent.all(:id => “me”), if you would like the events from the current user you must give an active access token The default value of app_id is your application_id and for token it is the app token To use this in your app: include Raicebook and then in index action for example: so in the view you can do a each loop on the events



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/raicebook/fb_events.rb', line 15

def self.all(options={})
  # default value for facebook app
  default_options = {
    :id    => Facebook::APP_ID,
    :token => get_app_acc_token
  }
  options = default_options.merge(options)
  
  graph = Koala::Facebook::GraphAPI.new(options[:token])
  graph.get_connections(options[:id], "feed")
end