Class Facebooker::Session
In: lib/facebooker/session.rb
Parent: Object

Methods

Classes and Modules

Class Facebooker::Session::AlbumIsFull
Class Facebooker::Session::BlankFeedTitle
Class Facebooker::Session::CallOutOfOrder
Class Facebooker::Session::ConfigurationMissing
Class Facebooker::Session::Desktop
Class Facebooker::Session::FQLFieldDoesNotExist
Class Facebooker::Session::FQLFunctionDoesNotExist
Class Facebooker::Session::FQLParseError
Class Facebooker::Session::FQLStatementNotIndexable
Class Facebooker::Session::FQLTableDoesNotExist
Class Facebooker::Session::FQLWrongNumberArgumentsPassedToFunction
Class Facebooker::Session::FeedBodyDataInvalid
Class Facebooker::Session::FeedBodyLengthTooLong
Class Facebooker::Session::FeedBodyTemplateInvalid
Class Facebooker::Session::FeedMarkupInvalid
Class Facebooker::Session::FeedPhotosNotRetrieved
Class Facebooker::Session::FeedTargetIdsInvalid
Class Facebooker::Session::FeedTitleDataInvalid
Class Facebooker::Session::FeedTitleTemplateInvalid
Class Facebooker::Session::HostNotAllowed
Class Facebooker::Session::IncorrectSignature
Class Facebooker::Session::InvalidAPIKey
Class Facebooker::Session::InvalidAlbumId
Class Facebooker::Session::InvalidFeedPhotoLink
Class Facebooker::Session::InvalidFeedPhotoSource
Class Facebooker::Session::InvalidFeedTitleLength
Class Facebooker::Session::InvalidFeedTitleLink
Class Facebooker::Session::InvalidFeedTitleName
Class Facebooker::Session::MaxRequestsDepleted
Class Facebooker::Session::MissingOrInvalidImageFile
Class Facebooker::Session::MissingOrInvalidParameter
Class Facebooker::Session::ServiceUnavailable
Class Facebooker::Session::SessionExpired
Class Facebooker::Session::SignatureTooOld
Class Facebooker::Session::TooManyUnapprovedPhotosPending
Class Facebooker::Session::TooManyUserActionCalls
Class Facebooker::Session::TooManyUserCalls
Class Facebooker::Session::UnknownError

Constants

API_SERVER_BASE_URL = "api.facebook.com"
API_PATH_REST = "/restserver.php"
WWW_SERVER_BASE_URL = "www.facebook.com"
WWW_PATH_LOGIN = "/login.php"
WWW_PATH_ADD = "/add.php"
WWW_PATH_INSTALL = "/install.php"

Attributes

auth_token  [W] 
session_key  [R] 

Public Class methods

Public Instance methods

Submit the enclosed requests for this session inside a batch

All requests will be sent to Facebook at the end of the block each method inside the block will return a proxy object attempting to access the proxy before the end of the block will yield an exception

For Example:

  facebook_session.batch do
    @send_result = facebook_session.send_notification([12451752],"Woohoo")
    @albums = facebook_session.user.albums
  end
  puts @albums.first.inspect

is valid, however

  facebook_session.batch do
    @send_result = facebook_session.send_notification([12451752],"Woohoo")
    @albums = facebook_session.user.albums
    puts @albums.first.inspect
  end

will raise Facebooker::BatchRequest::UnexecutedRequest

If an exception is raised while processing the result, that exception will be re-raised on the next access to that object or when exception_raised? is called

for example, if the send_notification resulted in TooManyUserCalls being raised, calling

  @send_result.exception_raised?

would re-raise that exception if there was an error retrieving the albums, it would be re-raised when

 @albums.first

is called

Given an array like: [[userid, otheruserid], [yetanotherid, andanotherid]] returns a Hash indicating friendship of those pairs: {[userid, otheruserid] => true, [yetanotherid, andanotherid] => false} if one of the Hash values is nil, it means the facebook platform‘s answer is "I don‘t know"

Returns a proxy object for handling calls to the Facebook Data API

This one has so many parameters, a Hash seemed cleaner than a long param list. Options can be: :uid => Filter by events associated with a user with this uid :eids => Filter by this list of event ids. This is a comma-separated list of eids. :start_time => Filter with this UTC as lower bound. A missing or zero parameter indicates no lower bound. (Time or Integer) :end_time => Filter with this UTC as upper bound. A missing or zero parameter indicates no upper bound. (Time or Integer) :rsvp_status => Filter by this RSVP status.

Send email to as many as 100 users at a time

Returns a proxy object for handling calls to Facebook cached items such as images and FBML ref handles

Only serialize the bare minimum to recreate the session.

[Validate]