NAME

Facebook::Graph - An interface to the Facebook Graph API.

VERSION

version 0.0200

SYNOPSIS

my $fb = Facebook::Graph->new;
my $sarah_bownds = $fb->fetch('sarahbownds');
my $perl_page = $fb->fetch('16665510298');

Or better yet:

my $sarah_bownds = $fb->query
   ->find('sarahbownds')
   ->include_metadata
   ->select_fields(qw( id name picture ))
   ->request
   ->as_hashref;

Building A Privileged App

my $fb = Facebook::Graph->new(
   app_id          => $facebook_application_id,
   secret          => $facebook_application_secret,
   postback        => 'https://www.yourapplication.com/facebook/oauth/postback',
);

Get the user to authorize your app (only needed if you want to fetch non-public information or publish stuff):

my $uri = $fb
   ->authorize
   ->add_permissions(qw(offline_access publish_stream))
   ->uri_as_string;

# redirect the user's browser to $uri

Handle the Facebook authorization code postback:

my $q = Plack::Request->new($env);
$fb->request_access_token($q->query_param('code'));

Or if you already had the access token:

$fb->set_access_token($token);

Get some info:

my $user = $fb->fetch('me');
my $friends = $fb->fetch('me/friends');
my $sarah_bownds = $fb->fetch('sarahbownds');

DESCRIPTION

This is a Perl interface to the Facebook Graph API http://developers.facebook.com/docs/api.

WARNING: This module is experimental at best. The work on it has only just begun because the Graph API itself isn't very new. Therefore things are subject to change drastically with each release, and it may fail to work entirely.

TODO

Basically everything. It has hardly any tests, very little documentation, and very little functionality in it's present form.

METHODS

See the SYNOPSIS for the time being.

NOTE: The fetch method is quick and dirty. Consider using query (Facebook::Graph::Query) instead.

PREREQS

Moose JSON LWP URI Crypt::SSLeay

SUPPORT

Repository

http://github.com/rizen/Facebook-Graph

Bug Reports

http://github.com/rizen/Facebook-Graph/issues

SEE ALSO

If you're looking for a fully featured Facebook client in Perl I highly recommend WWW::Facebook:API. It does just about everything, it just uses the old Facebook API.

AUTHOR

JT Smith <jt_at_plainblack_dot_com>

LEGAL

Facebook::Graph is Copyright 2010 Plain Black Corporation (http://www.plainblack.com) and is licensed under the same terms as Perl itself.