NAME

WWW::Facebook::API::Base - Base class for Client

VERSION

This document describes WWW::Facebook::API::Base version 0.2.0

SYNOPSIS

use WWW::Facebook::API;

DESCRIPTION

Base methods and data for WWW::Facebook::API and friends.

SUBROUTINES/METHODS

new

Returns a new instance of this class.

format

The default format to use if none is supplied with an API method call. Currently available options are XML and JSON. Defaults to XML.

parse_response

Defaults to 0. If set to true, if the format is set to XML, XML::Simple is used to parse the response from the server. Likewise, if the format is set to JSON, <JSON::XS> is used JSON to return a Perlish data structure.

call

The method which other submodules within WWW::Facebook::API use to call the Facebook REST interface. It takes in a hash signifying the method to be called (e.g., 'auth.getSession'), and key/value pairs for the parameters to use.

mech

The WWW::Mechanize agent used to communicate with the REST server. Shouldn't be needed for anything. The agent_alias is set to "Perl-WWW-Facebook-API-REST-Client/$VERSION".

server_uri

The server uri to access the Facebook REST server. Default is 'http://api.facebook.com/restserver.php'. See the Facebook API documentation.

secret

For a desktop application, this is the secret that is used for calling auth-create_token> and auth-get_session>. See the Facebook API documentation under Authentication. If no secret is passed in to the new method, it will prompt for one to be entered from STDIN.

api_key

The developer's API key. See the Facebook API documentation. If no api_key is passed in to the new method, it will prompt for one to be entered from STDIN.

session_key

The session key for the client's user. See the Facebook API documentation.

session_expires

The session expire timestamp for the client's user. See the Facebook API documentation.

session_uid

The session's uid for the client's user. See the Facebook API documentation.

desktop

A boolean signifying if the client is being used for a desktop application. See the Facebook API documentation.

errors

See WWW::Facebook::API::Errors. Basically, a grouping of the data that handles errors and debug information.

api_version

Which version to use (default is "1.0", which is the only one supported currently. Corresponds to the argument v that is passed in to methods as a parameter.

callback

The callback URL for your application. See the Facebook API documentation.

next

See the Facebook API documentation.

See the Facebook API documentation.

skipcookie

See the Facebook API documentation.

INTERNAL METHODS AND FUNCTIONS

_reformat_params

Reformat parameters according to Facebook API spec.

_update_params

Updates values for parameters that are passed in.

_post_request

Used by call to post the request to the REST server and return the response.

_create_sig_for

Creates signature (md5) for the post parameters, and returns a reference to the post parameters with the sig as the last element in the list.

_parse

Calls either JSON::XS or XML::Simple to parse the response received from the Facebook server. Returns the response via call.

DIAGNOSTICS

Unable to load %s module for parsing

JSON::XS or XML::Simple is cannot be loaded. Make sure it is installed if you are setting parse_response to 1.

Error during REST call: %s

This means that there's most likely an error in the server you are using to communicate to the Facebook REST server. Look at the traceback to determine why an error was thrown. Double-check that server_uri is set to the right location.

See WWW::Facebook::API::Errors.

CONFIGURATION AND ENVIRONMENT

WWW::Facebook::API::Base requires no configuration files or environment variables.

DEPENDENCIES

See WWW::Facebook::API

INCOMPATIBILITIES

None.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-www-facebook-api@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

David Romano <unobe@cpan.org>

LICENSE AND COPYRIGHT

Copyright (c) 2007, David Romano <unobe@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.