Sha256: 11be8c3b76a72d70944e2bf8fbbc6307ba252bf73b0537e6137ba3f576f45bd3

Contents?: true

Size: 1.41 KB

Versions: 24

Compression:

Stored size: 1.41 KB

Contents

module Facebooker
  class Application
    def initialize(session)
      @session = session
    end
    
    # +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['FACEBOOKER_RELATIVE_URL_ROOT'])
    def get_public_info(properties)
      (@session.post 'facebook.application.getPublicInfo', properties)
    end
    
    # facebook_session.application.add_global_news [{ :message => 'Hi all users', :action_link => { :text => "Hi application", :href => 'http://facebook.er/' }}], 'http://facebook.er/icon.png'
    def add_global_news(news, image=nil)
      params = {}
      params[:news] = news
      params[:image] = image if image
      @session.post('facebook.dashboard.addGlobalNews', params)
    end
    
    # currently bugged on Facebook; returns all
    # facebook_session.application.get_global_news '310354202543'
    def get_global_news(*news_ids)
      params = {}
      params[:news_ids] = news_ids.flatten if news_ids
      @session.post('facebook.dashboard.getGlobalNews', params)
    end
    
    # facebook_session.application.clear_global_news '310354202543'
    def clear_global_news(*news_ids)
      params = {}
      params[:news_ids] = news_ids.flatten if news_ids
      @session.post('facebook.dashboard.clearGlobalNews', params)
    end
    
  end
end

Version data entries

24 entries across 24 versions & 9 rubygems

Version Path
facebooker-1.0.75 lib/facebooker/application.rb
sentientmonkey-facebooker-1.0.74 lib/facebooker/application.rb
facebooker-micah-1.0.74 lib/facebooker/application.rb
facebooker-1.0.74 lib/facebooker/application.rb
facebooker-1.0.73 lib/facebooker/application.rb
facebooker-1.0.72 lib/facebooker/application.rb
facebooker-1.0.71 lib/facebooker/application.rb
facebooker-1.0.70 lib/facebooker/application.rb
benhutton-facebooker-1.0.69.2 lib/facebooker/application.rb
benhutton-facebooker-1.0.69.1 lib/facebooker/application.rb
facebooker-rails3-1.0.64 lib/facebooker/application.rb
facebooker-1.0.69 lib/facebooker/application.rb
cbaclig-facebooker-1.0.67.3 lib/facebooker/application.rb
facebooker-1.0.68 lib/facebooker/application.rb
cbaclig-facebooker-1.0.67.2 lib/facebooker/application.rb
facebooker-lite-1.0.67.2 lib/facebooker/application.rb
facebooker-lite-1.0.67.1 lib/facebooker/application.rb
facebooker-lite-1.0.67 lib/facebooker/application.rb
fotonauts-facebooker-1.0.67 lib/facebooker/application.rb
facebooker-1.0.67 lib/facebooker/application.rb