Class: Facebooker::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/facebooker/application.rb

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ Application

Returns a new instance of Application.



3
4
5
# File 'lib/facebooker/application.rb', line 3

def initialize(session)
  @session = session
end

Instance Method Details

#add_global_news(news, image = nil) ⇒ Object

facebook_session.application.add_global_news [{ :message => ‘Hi all users’, :action_link => { :text => “Hi application”, :href => ‘facebook.er/’ }}], ‘



14
15
16
17
18
19
# File 'lib/facebooker/application.rb', line 14

def add_global_news(news, image=nil)
  params = {}
  params[:news] = news
  params[:image] = image if image
  @session.post('facebook.dashboard.addGlobalNews', params)
end

#clear_global_news(*news_ids) ⇒ Object

facebook_session.application.clear_global_news ‘310354202543’



30
31
32
33
34
# File 'lib/facebooker/application.rb', line 30

def clear_global_news(*news_ids)
  params = {}
  params[:news_ids] = news_ids.flatten if news_ids
  @session.post('facebook.dashboard.clearGlobalNews', params)
end

#get_global_news(*news_ids) ⇒ Object

currently bugged on Facebook; returns all facebook_session.application.get_global_news ‘310354202543’



23
24
25
26
27
# File 'lib/facebooker/application.rb', line 23

def get_global_news(*news_ids)
  params = {}
  params[:news_ids] = news_ids.flatten if news_ids
  @session.post('facebook.dashboard.getGlobalNews', params)
end

#get_public_info(properties) ⇒ Object

properties: Hash of properties of the desired application. Specify exactly one of: application_id, application_api_key or application_canvas_name eg: application.get_public_info(:application_canvas_name => ENV)



9
10
11
# File 'lib/facebooker/application.rb', line 9

def get_public_info(properties)
  (@session.post 'facebook.application.getPublicInfo', properties)
end