The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 012
MANIFEST 62
META.yml 34
Makefile.PL 33
README 11
author.t/authenticate.t 12
author.t/private_fetch.t 11
author.t/private_query.t 041
author.t/publish_comment.t 22
author.t/publish_event.t 450
author.t/publish_like.t 22
author.t/publish_note.t 190
author.t/publish_to_feed.t 91
author.t/rsvp_attending.t 22
author.t/rsvp_declined.t 22
author.t/rsvp_maybe.t 22
dist.ini 22
lib/Facebook/Graph/AccessToken/Response.pm 54
lib/Facebook/Graph/AccessToken.pm 634
lib/Facebook/Graph/Authorize.pm 1422
lib/Facebook/Graph/BatchRequests.pm 619
lib/Facebook/Graph/Cookbook/Recipe1.pod 11
lib/Facebook/Graph/Cookbook/Recipe2.pod 11
lib/Facebook/Graph/Cookbook/Recipe3.pod 11
lib/Facebook/Graph/Cookbook.pod 11
lib/Facebook/Graph/Page/Feed.pm 64
lib/Facebook/Graph/Picture.pm 823
lib/Facebook/Graph/Publish/Checkin.pm 98
lib/Facebook/Graph/Publish/Comment.pm 64
lib/Facebook/Graph/Publish/Event.pm 1920
lib/Facebook/Graph/Publish/Like.pm 64
lib/Facebook/Graph/Publish/Link.pm 64
lib/Facebook/Graph/Publish/Note.pm 1090
lib/Facebook/Graph/Publish/PageTab.pm 54
lib/Facebook/Graph/Publish/Photo.pm 54
lib/Facebook/Graph/Publish/Post.pm 1311
lib/Facebook/Graph/Publish/RSVPAttending.pm 64
lib/Facebook/Graph/Publish/RSVPDeclined.pm 64
lib/Facebook/Graph/Publish/RSVPMaybe.pm 64
lib/Facebook/Graph/Publish.pm 85
lib/Facebook/Graph/Query.pm 86
lib/Facebook/Graph/Request.pm 65
lib/Facebook/Graph/Response.pm 65
lib/Facebook/Graph/Role/Uri.pm 414
lib/Facebook/Graph/Session.pm 64
lib/Facebook/Graph.pm 6328
t/01_versioned_path.t 013
t/02_public_fetch.t 130
t/03_public_query.t 380
t/04_picture.t 44
50 files changed (This is a version diff) 674324
@@ -1,3 +1,15 @@
+1.1000 2015-03-20
+ - More POD thanks to Nathan Handy.
+ - Upgraded to Facebook Graph v2.2 API, and all the changes that come with it.
+ - Allow for Facebook's versioned URLs.
+ - Removed the following APIs as they are no longer supported in Facebook's Graph v2 API: FQL, publishing notes, publishing events
+ - You can no longer do public queries (queries without an access token).
+ - You can no longer do queries using usernames or object names, you must use object ids.
+ - Removed "display" from Facebook::Graph::Authorize as Facebook no longer supports it.
+
+1.0900 2014-12-25
+ - Replace Any::Moose in favor of Moo.
+
 1.0801 2014-09-07
  - Fix for hash randomization thanks to syohex.
 
@@ -8,11 +8,10 @@ README
 author.t/authenticate.t
 author.t/batch_requests.t
 author.t/private_fetch.t
+author.t/private_query.t
 author.t/publish_comment.t
-author.t/publish_event.t
 author.t/publish_like.t
 author.t/publish_link.t
-author.t/publish_note.t
 author.t/publish_post.t
 author.t/publish_to_feed.t
 author.t/rsvp_attending.t
@@ -51,10 +50,8 @@ lib/Facebook/Graph/Picture.pm
 lib/Facebook/Graph/Publish.pm
 lib/Facebook/Graph/Publish/Checkin.pm
 lib/Facebook/Graph/Publish/Comment.pm
-lib/Facebook/Graph/Publish/Event.pm
 lib/Facebook/Graph/Publish/Like.pm
 lib/Facebook/Graph/Publish/Link.pm
-lib/Facebook/Graph/Publish/Note.pm
 lib/Facebook/Graph/Publish/PageTab.pm
 lib/Facebook/Graph/Publish/Photo.pm
 lib/Facebook/Graph/Publish/Post.pm
@@ -66,9 +63,8 @@ lib/Facebook/Graph/Request.pm
 lib/Facebook/Graph/Response.pm
 lib/Facebook/Graph/Role/Uri.pm
 lib/Facebook/Graph/Session.pm
-t/02_public_fetch.t
+t/01_versioned_path.t
 t/02_signed_requests.t
-t/03_public_query.t
 t/04_picture.t
 t/release-pod-coverage.t
 t/release-pod-syntax.t
@@ -6,7 +6,7 @@ build_requires: {}
 configure_requires:
   ExtUtils::MakeMaker: '6.30'
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.019, CPAN::Meta::Converter version 2.141170'
+generated_by: 'Dist::Zilla version 5.019, CPAN::Meta::Converter version 2.142690'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -17,20 +17,20 @@ no_index:
     - author.t
     - eg
 requires:
-  Any::Moose: '0.13'
   AnyEvent::HTTP::LWP::UserAgent: '0.08'
   AnyEvent::TLS: '0'
   DateTime: '0.61'
   DateTime::Format::Strptime: '1.4000'
   JSON: '2.16'
   MIME::Base64::URLSafe: '0.01'
+  Moo: '0'
   Ouch: '0.0400'
   Test::More: '0'
   URI: '1.54'
 resources:
   bugtracker: http://github.com/rizen/Facebook-Graph/issues
   repository: git://github.com/rizen/Facebook-Graph.git
-version: '1.0801'
+version: '1.1000'
 x_contributors:
   - 'Adam Hopkins <SirChickenHair@srchulo-aire.local>'
   - 'Andrew Grangaard <granny-github@ofb.net>'
@@ -44,6 +44,7 @@ x_contributors:
   - 'Mark Carey <mark@mt-hacks.com>'
   - 'Mark Stosberg <mark@stosberg.com>'
   - 'Maroun NAJM <mnajm@cinemoz.com>'
+  - 'Nathan Handy <nhandy@Nathans-MacBook-Pro.local>'
   - 'Sebastien Wernerus <s.wernerus@gmail.com>'
   - 'Syohei YOSHIDA <syohex@gmail.com>'
   - 'Tim Heaney <oylenshpeegul@gmail.com>'
@@ -20,18 +20,18 @@ my %WriteMakefileArgs = (
   "LICENSE" => "perl",
   "NAME" => "Facebook::Graph",
   "PREREQ_PM" => {
-    "Any::Moose" => "0.13",
     "AnyEvent::HTTP::LWP::UserAgent" => "0.08",
     "AnyEvent::TLS" => 0,
     "DateTime" => "0.61",
     "DateTime::Format::Strptime" => "1.4000",
     "JSON" => "2.16",
     "MIME::Base64::URLSafe" => "0.01",
+    "Moo" => 0,
     "Ouch" => "0.0400",
     "Test::More" => 0,
     "URI" => "1.54"
   },
-  "VERSION" => "1.0801",
+  "VERSION" => "1.1000",
   "test" => {
     "TESTS" => "t/*.t"
   }
@@ -39,13 +39,13 @@ my %WriteMakefileArgs = (
 
 
 my %FallbackPrereqs = (
-  "Any::Moose" => "0.13",
   "AnyEvent::HTTP::LWP::UserAgent" => "0.08",
   "AnyEvent::TLS" => 0,
   "DateTime" => "0.61",
   "DateTime::Format::Strptime" => "1.4000",
   "JSON" => "2.16",
   "MIME::Base64::URLSafe" => "0.01",
+  "Moo" => 0,
   "Ouch" => "0.0400",
   "Test::More" => 0,
   "URI" => "1.54"
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution Facebook-Graph,
-version 1.0801:
+version 1.1000:
 
   A fast and easy way to integrate your apps with Facebook.
 
@@ -1,5 +1,6 @@
 use Test::More;
 use strict;
+use lib '../lib';
 
 die "You need to set an environment variable for FB_APP_ID && FB_SECRET to test this" unless $ENV{FB_APP_ID} && $ENV{FB_SECRET};
 
@@ -11,7 +12,7 @@ my $fb = Facebook::Graph->new(
     );
 isa_ok($fb, 'Facebook::Graph');
 
-my $uri = $fb->authorize->extend_permissions(qw(offline_access read_stream publish_stream))->uri_as_string;
+my $uri = $fb->authorize->extend_permissions(qw(offline_access read_stream publish_stream manage_pages))->uri_as_string;
 
 print "Point your browser here: $uri
 
@@ -9,7 +9,7 @@ die "You need to set an environment variable for FB_ACCESS_TOKEN to test this" u
 
 $fb->access_token($ENV{FB_ACCESS_TOKEN});
 
-my $sarah = eval{$fb->fetch('sarahbownds')};
+my $sarah = eval{$fb->fetch(767598108)};
 use Data::Dumper;
 die Dumper($@) if $@;
 ok(ref $sarah eq 'HASH', 'got a hash ref back');
@@ -0,0 +1,41 @@
+use Test::More tests => 16;
+use lib '../lib';
+use Ouch;
+
+use_ok('Facebook::Graph');
+my $fb = Facebook::Graph->new;
+isa_ok($fb, 'Facebook::Graph');
+
+die "You need to set an environment variable for FB_ACCESS_TOKEN to test this" unless $ENV{FB_ACCESS_TOKEN};
+$fb->access_token($ENV{FB_ACCESS_TOKEN});
+
+my $sarah_query = $fb->query
+    ->find('767598108')
+    ->select_fields(qw(name id))
+    ->include_metadata;
+isa_ok($sarah_query, 'Facebook::Graph::Query');
+my $got = URI->new($sarah_query->uri_as_string);
+is($got->scheme, 'https', 'scheme of generated uri');
+is($got->host, 'graph.facebook.com', 'host of generated uri');
+is($got->path, '/v2.2/767598108', 'path of generated uri');
+my %query = $got->query_form;
+is_deeply(\%query, {fields => 'name,id', metadata => '1', access_token => $ENV{FB_ACCESS_TOKEN}}, 'query of generated uri');
+
+my $sarah_response = $sarah_query->request;
+isa_ok($sarah_response, 'Facebook::Graph::Response');
+my $sarah = eval{$sarah_response->as_hashref};
+
+die $@ if $@;
+
+ok(ref $sarah eq 'HASH', 'got a hash ref back');
+is($sarah->{id}, '767598108', 'got sarah');
+is($sarah->{name}, 'Sarah Bownds', 'know her name');
+is(scalar(keys %{$sarah}), 3, 'only fetched the things i asked for');
+is($sarah->{metadata}{type}, 'user', 'she is a user');
+
+eval { $fb->query->select_fields('')->request->as_json };
+is($@->code, 400, 'exception inherits http status code');
+like($@->message, qr#\QUnsupported get request\E#, 'exception gives good detail');
+
+is $fb->request('https://graph.facebook.com/amazon')->as_hashref->{username}, 'Amazon', 'can directly fetch a facebook graph url' ;
+
@@ -9,7 +9,7 @@ die "You need to set an environment variable for FB_ACCESS_TOKEN to test this" u
 
 $fb->access_token($ENV{FB_ACCESS_TOKEN});
 
-my $response = $fb->add_post('jt.smith.169')
+my $response = $fb->add_post('1647395831')
     ->set_message('This is a test post of the Facebook::Graph perl module with epoch: '.time())
     ->publish;
 my $out = $response->as_hashref;
@@ -23,4 +23,4 @@ $out = $response->as_hashref;
 ok(ref $out eq 'HASH', 'got a hash back') or debug($response->as_json);
 ok(exists $out->{id}, 'we got back an id');
 
-done_testing();
\ No newline at end of file
+done_testing();
@@ -1,45 +0,0 @@
-use Test::More tests => 8;
-use lib '../lib';
-
-use_ok('Facebook::Graph');
-my $fb = Facebook::Graph->new;
-isa_ok($fb, 'Facebook::Graph');
-
-die "You need to set an environment variable for FB_ACCESS_TOKEN to test this" unless $ENV{FB_ACCESS_TOKEN};
-
-$fb->access_token($ENV{FB_ACCESS_TOKEN});
-
-my $response = $fb->add_event
-  ->set_start_time(DateTime->new(year => 2012, month => 1, day => 1))
-  ->set_end_time(DateTime->new(year => 2012, month => 1, day => 2))
-  ->set_name('The Apocalypse')
-  ->set_description('The date that idiots believe the end of the world is coming.')
-  ->set_location('The Whole World!')
-  ->publish;
-my $out = $response->as_hashref;
-ok(ref $out eq 'HASH', 'got a hash back') or debug($response->as_json);
-ok(exists $out->{id}, 'we got back an id');
-
-$response = $fb->add_event(176943642329328)
-  ->set_start_time(DateTime->new(year => 2012, month => 1, day => 1))
-  ->set_end_time(DateTime->new(year => 2012, month => 1, day => 2))
-  ->set_name('The Apocalypse')
-  ->set_description('The date that idiots believe the end of the world is coming.')
-  ->set_location('The Whole World!')
-  ->publish;
-$out = $response->as_hashref;
-ok(ref $out eq 'HASH', 'got a hash back from community page') or debug($response->as_json);
-ok(exists $out->{id}, 'we got back an id from community page');
-
-
-$response = $fb->add_event(182872885058638)
-  ->set_start_time(DateTime->new(year => 2012, month => 1, day => 1))
-  ->set_end_time(DateTime->new(year => 2012, month => 1, day => 2))
-  ->set_name('The Apocalypse')
-  ->set_description('The date that idiots believe the end of the world is coming.')
-  ->set_location('The Whole World!')
-  ->publish;
-$out = $response->as_hashref;
-ok(ref $out eq 'HASH', 'got a hash back from official page') or debug($response->as_json);
-ok(exists $out->{id}, 'we got back an id from official page');
-
@@ -9,7 +9,7 @@ die "You need to set an environment variable for FB_ACCESS_TOKEN to test this" u
 
 $fb->access_token($ENV{FB_ACCESS_TOKEN});
 
-my $response = $fb->add_like('635277468_144288935595157')
+my $response = $fb->add_like('10205372177817727')
   ->publish;
-is($response->as_string, 'true', 'we get back a true string');
+is($response->as_string, '{"success":true}', 'we get back a true string');
 
@@ -1,19 +0,0 @@
-use Test::More tests => 4;
-use lib '../lib';
-
-use_ok('Facebook::Graph');
-my $fb = Facebook::Graph->new;
-isa_ok($fb, 'Facebook::Graph');
-
-die "You need to set an environment variable for FB_ACCESS_TOKEN to test this" unless $ENV{FB_ACCESS_TOKEN};
-
-$fb->access_token($ENV{FB_ACCESS_TOKEN});
-
-my $response = $fb->add_note
-  ->set_message('This is a test note message.')
-  ->set_subject('This is a test note subject.')
-  ->publish;
-my $out = $response->as_hashref;
-ok(ref $out eq 'HASH', 'got a hash back') or debug($response->as_json);
-ok(exists $out->{id}, 'we got back an id');
-
@@ -1,4 +1,4 @@
-use Test::More tests => 10;
+use Test::More tests => 8;
 use lib '../lib';
 
 use_ok('Facebook::Graph');
@@ -38,11 +38,3 @@ ok(ref $out eq 'HASH', 'got a hash back on simple post to community page') or di
 ok(exists $out->{id}, 'we got back an id on simple post to community page');
 
 
-$response = $fb->add_post(182872885058638)
-  ->set_message('This is me testing')
-    ->set_link_uri('http://www.perl.org/')
-  ->publish;
-$out = $response->as_hashref;
-ok(ref $out eq 'HASH', 'got a hash back on simple post to community page') or diag($response->as_json);
-ok(exists $out->{id}, 'we got back an id on simple post to community page');
-
@@ -9,7 +9,7 @@ die "You need to set an environment variable for FB_ACCESS_TOKEN to test this" u
 
 $fb->access_token($ENV{FB_ACCESS_TOKEN});
 
-my $response = $fb->rsvp_attending('141730949193973')
+my $response = $fb->rsvp_attending('1727225617504143')
   ->publish;
-is($response->as_string, 'true', 'we get back a true string');
+is($response->as_string, '{"success":true}', 'we get back a true string');
 
@@ -9,7 +9,7 @@ die "You need to set an environment variable for FB_ACCESS_TOKEN to test this" u
 
 $fb->access_token($ENV{FB_ACCESS_TOKEN});
 
-my $response = $fb->rsvp_declined('141730949193973')
+my $response = $fb->rsvp_declined('1727225617504143')
   ->publish;
-is($response->as_string, 'true', 'we get back a true string');
+is($response->as_string, '{"success":true}', 'we get back a true string');
 
@@ -9,7 +9,7 @@ die "You need to set an environment variable for FB_ACCESS_TOKEN to test this" u
 
 $fb->access_token($ENV{FB_ACCESS_TOKEN});
 
-my $response = $fb->rsvp_maybe('141730949193973')
+my $response = $fb->rsvp_maybe('1727225617504143')
   ->publish;
-is($response->as_string, 'true', 'we get back a true string');
+is($response->as_string, '{"success":true}', 'we get back a true string');
 
@@ -3,7 +3,7 @@ author  = JT Smith <jt@plainblack.com>
 license = Perl_5
 copyright_holder = Plain Black Corporation
 copyright_year   = 2014
-version = 1.0801
+version = 1.1000
 
 [@Classic]
 
@@ -14,7 +14,7 @@ repository.web    = http://github.com/rizen/Facebook-Graph
 repository.type   = git
 
 [Prereqs]
-Any::Moose = 0.13
+Moo = 0
 JSON = 2.16
 Test::More = 0
 URI = 1.54
@@ -1,6 +1,6 @@
 package Facebook::Graph::AccessToken::Response;
-$Facebook::Graph::AccessToken::Response::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::AccessToken::Response::VERSION = '1.1000';
+use Moo;
 use URI;
 use URI::QueryParam;
 use Ouch;
@@ -52,8 +52,7 @@ sub _retrieve_error_message {
     }
 }
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 =head1 NAME
 
@@ -61,7 +60,7 @@ Facebook::Graph::AccessToken::Response - The Facebook access token request respo
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 Description
 
@@ -1,6 +1,6 @@
 package Facebook::Graph::AccessToken;
-$Facebook::Graph::AccessToken::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::AccessToken::VERSION = '1.1000';
+use Moo;
 use Facebook::Graph::AccessToken::Response;
 use Facebook::Graph::Request;
 with 'Facebook::Graph::Role::Uri';
@@ -70,9 +70,7 @@ sub request {
     );
 }
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -81,7 +79,7 @@ Facebook::Graph::AccessToken - Acquire an access token from Facebook.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -101,6 +99,32 @@ Allows you to request an access token from Facebook so you can make privileged r
 
 =head1 METHODS
 
+=head2 new ( [ params ] )
+
+=over
+
+=item params
+
+A hash or hashref of parameters to pass to the constructor.
+
+=over
+
+=item app_id
+
+The application id that you get from Facebook after registering (L<http://developers.facebook.com/setup/>) your application on their site. Required if you'll be calling the C<request_access_token>, C<convert_sessions>, or C<authorize> methods.
+
+=item code
+
+An authorization code string that you should have gotten by going through the C<authorize> process.
+
+=item postback
+
+The URI that Facebook should post your authorization code back to. Required if you'll be calling the C<request_access_token> or C<authorize> methods.
+
+=item secret
+
+The application secret that you get from Facebook after registering your application. Required if you'll be calling the C<request_access_token> or C<convert_sessions> methods.
+
 =head2 uri_as_string ()
 
 Returns the URI that will be called to fetch the token as a string. Mostly useful for debugging and testing.
@@ -109,6 +133,10 @@ Returns the URI that will be called to fetch the token as a string. Mostly usefu
 
 Makes a request to Facebook to fetch an access token. Returns a L<Facebook::Graph::AccessToken::Response> object.
 
+=head2 build ()
+
+Checks for either access_token or code and dies if has neither.
+
 =head1 LEGAL
 
 Facebook::Graph is Copyright 2010 - 2012 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
@@ -1,6 +1,6 @@
 package Facebook::Graph::Authorize;
-$Facebook::Graph::Authorize::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Authorize::VERSION = '1.1000';
+use Moo;
 with 'Facebook::Graph::Role::Uri';
 
 has app_id => (
@@ -22,7 +22,7 @@ has permissions => (
 
 has display => (
     is      => 'rw',
-    default => 'page',
+    default => sub { 'page' },
 );
 
 sub extend_permissions {
@@ -53,8 +53,7 @@ sub uri_as_string {
     return $uri->as_string;
 }
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 
 =head1 NAME
@@ -64,7 +63,7 @@ Facebook::Graph::Authorize - Authorizing an app with Facebook
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -85,22 +84,31 @@ Get an authorization code from Facebook so that you can request an access token
 
 =head1 METHODS
 
-=head2 extend_permissions ( permissions )
+=head2 new ( [ params ] )
 
-Ask for extra permissions for your app. By default, if you do not request extended permissions your app will have access to only general information that any Facebook user would have. Returns a reference to self for method chaining.
+=over
 
-=head3 permissions
+=item params
 
-An array of permissions. See L<http://developers.facebook.com/docs/authentication/permissions> for more information about what's available.
+A hash or hashref of parameters to pass to the constructor.
+
+=over
+
+=item app_id
 
+The application id that you get from Facebook after registering (L<http://developers.facebook.com/setup/>) your application on their site.
 
-=head2 set_display ( type )
+=item postback
 
-Sets the display type for the authorization screen that a user will see.
+The URI that Facebook should post your authorization code back to.
 
-=head3 type
+=head2 extend_permissions ( permissions )
+
+Ask for extra permissions for your app. By default, if you do not request extended permissions your app will have access to only general information that any Facebook user would have. Returns a reference to self for method chaining.
 
-Defaults to C<page>. Valid types are C<page>, C<popup>, C<wap>, and C<touch>. See B<Dialog Form Factors> in L<http://developers.facebook.com/docs/authentication/> for details.
+=head3 permissions
+
+An array of permissions. See L<http://developers.facebook.com/docs/authentication/permissions> for more information about what's available.
 
 
 =head2 uri_as_string ( )
@@ -1,6 +1,6 @@
 package Facebook::Graph::BatchRequests;
-$Facebook::Graph::BatchRequests::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::BatchRequests::VERSION = '1.1000';
+use Moo;
 use Ouch;
 use Facebook::Graph::Request;
 
@@ -11,7 +11,7 @@ has access_token => (
 
 has requests => (
     is          => 'rw',
-    isa         => 'ArrayRef',
+    isa         => sub { ouch(442,"$_[0] is not an Array Reference") unless ref $_[0] eq 'ARRAY' },
     default     => sub { [] },
 );
 
@@ -56,8 +56,7 @@ sub request {
     return wantarray ? @$data : $data;
 }
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 =head1 NAME
 
@@ -65,7 +64,7 @@ Facebook::Graph::BatchRequests - Batch Requests
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -86,6 +85,20 @@ send batch requests to save time: L<http://developers.facebook.com/docs/referenc
 
 =head1 METHODS
 
+=head2 new ( [ params ] )
+
+=over
+
+=item params
+
+A hash or hashref of parameters to pass to the constructor.
+
+=over
+
+=item access_token
+
+An access token string used to make Facebook requests as a privileged user.
+
 =head2 add_request
 
 add request, if not HASHREF, will default method as GET and arg as relative_url
@@ -4,7 +4,7 @@ Facebook::Graph::Cookbook::Recipe1 - Building Privileged Applications
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 DESCRIPTION
 
@@ -4,7 +4,7 @@ Facebook::Graph::Cookbook::Recipe2 - Building a Full Web App
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 DESCRIPTION
 
@@ -4,7 +4,7 @@ Facebook::Graph::Cookbook::Recipe3 - Impersonation
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 DESCRIPTION
 
@@ -4,7 +4,7 @@ Facebook::Graph::Cookbook - A cookbook for Facebook::Graph
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 DESCRIPTION
 
@@ -1,8 +1,8 @@
 package Facebook::Graph::Page::Feed;
-$Facebook::Graph::Page::Feed::VERSION = '1.0801';
+$Facebook::Graph::Page::Feed::VERSION = '1.1000';
 use strict;
 $Facebook::Graph::Page::Feed::VERSION = '1.0700';
-use Any::Moose;
+use Moo;
 extends 'Facebook::Graph::Publish';
 
 has page_id => (
@@ -125,9 +125,7 @@ around get_post_params => sub {
 	return $post;
 };
 
-
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 =head1 NAME
 
@@ -135,7 +133,7 @@ Facebook::Graph::Page::Feed - Add a post to a Facebook page.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,6 +1,6 @@
 package Facebook::Graph::Picture;
-$Facebook::Graph::Picture::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Picture::VERSION = '1.1000';
+use Moo;
 with 'Facebook::Graph::Role::Uri';
 
 has type => (
@@ -10,7 +10,7 @@ has type => (
 
 has object_name => (
     is          => 'rw',
-    default     => '',
+    default     => sub {''},
 );
 
 sub get_small {
@@ -38,15 +38,13 @@ sub uri_as_string {
         $query{type} = $self->type;
     }
     my $uri = $self->uri;
-    $uri->path($self->object_name . '/picture');
+    $uri->path($self->generate_versioned_path($self->object_name . '/picture'));
     $uri->query_form(%query);
     return $uri->as_string;
 }
 
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -54,7 +52,7 @@ Facebook::Graph::Picture - Get the URI for the picture of any object.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -71,6 +69,23 @@ This module allows you to generate the URL needed to fetch a picture for any obj
 
 =head1 METHODS
 
+=head2 new ( [ params ] )
+
+=over
+
+=item params
+
+A hash or hashref of parameters to pass to the constructor.
+
+=over
+
+=item object_name
+
+An profile id like C<sarahbownds> or an object id like C<16665510298> for the Perl page.
+
+=item type
+
+Type of picture to return. Valid types are small, square, large
 
 =head2 get_large ( id )
 
@@ -1,6 +1,7 @@
 package Facebook::Graph::Publish::Checkin;
-$Facebook::Graph::Publish::Checkin::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::Checkin::VERSION = '1.1000';
+use Moo;
+use Ouch;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/checkins';
@@ -29,7 +30,7 @@ sub set_place {
 
 has longitude => (
     is          => 'rw',
-    isa         => 'Num',
+    isa         => sub { ouch(442,"$_[0] is not a number") unless looks_like_number $_[0] },
     predicate   => 'has_longitude',
 );
 
@@ -41,7 +42,7 @@ sub set_longitude {
 
 has latitude => (
     is          => 'rw',
-    isa         => 'Num',
+    isa         => sub { ouch(442,"$_[0] is not a number") unless looks_like_number $_[0] },
     predicate   => 'has_latitude',
 );
 
@@ -53,7 +54,7 @@ sub set_latitude {
 
 has tags => (
     is          => 'rw',
-    isa         => 'ArrayRef',
+    isa         => sub { ouch(442,"$_[0] is not an Array Reference") unless ref $_[0] eq 'ARRAY' },
     predicate   => 'has_tags',
     lazy        => 1,
     default     => sub {[]},
@@ -84,9 +85,7 @@ around get_post_params => sub {
    return $post;
 };
 
-
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 
 =head1 NAME
@@ -95,7 +94,7 @@ Facebook::Graph::Publish::Checkin - Publish a location checkin.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,6 +1,6 @@
 package Facebook::Graph::Publish::Comment;
-$Facebook::Graph::Publish::Comment::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::Comment::VERSION = '1.1000';
+use Moo;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/comments';
@@ -28,9 +28,7 @@ around get_post_params => sub {
 };
 
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -38,7 +36,7 @@ Facebook::Graph::Publish::Comment - Publish a comment on a post.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,192 +0,0 @@
-package Facebook::Graph::Publish::Event;
-$Facebook::Graph::Publish::Event::VERSION = '1.0801';
-use Any::Moose;
-extends 'Facebook::Graph::Publish';
-use DateTime;
-use DateTime::Format::Strptime;
-
-use constant object_path => '/events';
-
-has name => (
-    is          => 'rw',
-    predicate   => 'has_name',
-);
-
-sub set_name {
-    my ($self, $input) = @_;
-    $self->name($input);
-    return $self;
-}
-
-has description => (
-    is          => 'rw',
-    predicate   => 'has_description',
-);
-
-sub set_description {
-    my ($self, $input) = @_;
-    $self->description($input);
-    return $self;
-}
-
-has location => (
-    is          => 'rw',
-    predicate   => 'has_location',
-);
-
-sub set_location {
-    my ($self, $input) = @_;
-    $self->location($input);
-    return $self;
-}
-
-has start_time => (
-    is          => 'rw',
-    isa         => 'DateTime',
-    predicate   => 'has_start_time',
-);
-
-sub set_start_time {
-    my ($self, $start_time) = @_;
-    $self->start_time($start_time);
-    return $self;
-}
-
-has end_time => (
-    is          => 'rw',
-    isa         => 'DateTime',
-    predicate   => 'has_end_time',
-);
-
-sub set_end_time {
-    my ($self, $end_time) = @_;
-    $self->end_time($end_time);
-    return $self;
-}
-
-
-
-around get_post_params => sub {
-    my ($orig, $self) = @_;
-    my $post = $orig->($self);
-    unless ($self->object_name eq 'me') {
-        push @$post, page_id => $self->object_name;
-    }
-    if ($self->has_name) {
-        push @$post, name => $self->name;
-    }
-    if ($self->has_description) {
-        push @$post, description => $self->description;
-    }
-    if ($self->has_location) {
-        push @$post, location => $self->location;
-    }
-    my $strp = DateTime::Format::Strptime->new(pattern => '%FT %T%z');
-    if ($self->has_start_time) {
-        push @$post, start_time => $strp->format_datetime($self->start_time);
-    }
-    if ($self->has_end_time) {
-        push @$post, end_time => $strp->format_datetime($self->end_time);
-    }
-    return $post;
-};
-
-
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
-
-=head1 NAME
-
-Facebook::Graph::Publish::Event - Add an event.
-
-=head1 VERSION
-
-version 1.0801
-
-=head1 SYNOPSIS
-
- my $fb = Facebook::Graph->new;
-
- my $start = DateTime->new( month=>10, day=>31, year => 2010, hour=>20 );
- $fb->add_event
-    ->set_start_time($start)
-    ->set_end_time($start->clone->add(hours => 6))
-    ->set_name('Halloween Party')
-    ->publish;
-
-
-=head1 DESCRIPTION
-
-This module gives you quick and easy access to publish events.
-
-B<ATTENTION:> You must have the C<create_event> privilege to use this module.
-
-=head1 METHODS
-
-=head2 to ( id )
-
-Specify a profile id to post to. Defaults to 'me', which is the currently logged in user.
-
-
-=head2 set_name ( name )
-
-Sets the name of the event.
-
-=head3 name
-
-A string of text.
-
-
-=head2 set_description ( description )
-
-Sets the description of the event. Tell people what's going on.
-
-=head3 description
-
-A string of text.
-
-
-=head2 set_location ( location )
-
-Sets a general description of where the event will take place.
-
-=head3 location
-
-A string of text.
-
-
-=head2 set_start_time ( datetime )
-
-Sets the start of the event.
-
-=head3 datetime
-
-A L<DateTime> object.
-
-
-=head2 set_end_time ( datetime )
-
-Sets the end of the event.
-
-=head3 datetime
-
-A L<DateTime> object.
-
-
-=head2 publish ( )
-
-Posts the data and returns a L<Facebook::Graph::Response> object. The response object should contain the id:
-
- {"id":"1647395831_130068550371568"}
- 
- 
-=head1 TODO
-
-Add venue and privacy as described on L<http://developers.facebook.com/docs/reference/api/event>.
-
-=head1 LEGAL
-
-Facebook::Graph is Copyright 2010 - 2012 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
-
-=cut
@@ -1,13 +1,11 @@
 package Facebook::Graph::Publish::Like;
-$Facebook::Graph::Publish::Like::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::Like::VERSION = '1.1000';
+use Moo;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/likes';
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -15,7 +13,7 @@ Facebook::Graph::Publish::Like - Mark a post as something you like.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,6 +1,6 @@
 package Facebook::Graph::Publish::Link;
-$Facebook::Graph::Publish::Link::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::Link::VERSION = '1.1000';
+use Moo;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/links';
@@ -42,9 +42,7 @@ around get_post_params => sub {
 };
 
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -52,7 +50,7 @@ Facebook::Graph::Publish::Link - Add a link.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,109 +0,0 @@
-package Facebook::Graph::Publish::Note;
-$Facebook::Graph::Publish::Note::VERSION = '1.0801';
-use Any::Moose;
-extends 'Facebook::Graph::Publish';
-
-use constant object_path => '/notes';
-
-has message => (
-    is          => 'rw',
-    predicate   => 'has_message',
-);
-
-sub set_message {
-    my ($self, $message) = @_;
-    $self->message($message);
-    return $self;
-}
-
-has subject => (
-    is          => 'rw',
-    predicate   => 'has_subject',
-);
-
-sub set_subject {
-    my ($self, $subject) = @_;
-    $self->subject($subject);
-    return $self;
-}
-
-
-
-around get_post_params => sub {
-    my ($orig, $self) = @_;
-    my $post = $orig->($self);
-    if ($self->has_message) {
-        push @$post, message => $self->message;
-    }
-    if ($self->has_subject) {
-        push @$post, subject => $self->subject;
-    }
-    return $post;
-};
-
-
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
-
-=head1 NAME
-
-Facebook::Graph::Publish::Note - Add a note to a user's list of notes.
-
-=head1 VERSION
-
-version 1.0801
-
-=head1 SYNOPSIS
-
- my $fb = Facebook::Graph->new;
-
- $fb->add_note
-    ->set_subject('Things I Like')
-    ->set_message('I like beer.')
-    ->publish;
-
-
-=head1 DESCRIPTION
-
-This module gives you quick and easy access to publish notes.
-
-B<ATTENTION:> You must have the C<publish_stream> privilege to use this module.
-
-=head1 METHODS
-
-=head2 to ( id )
-
-Specify a profile id to post to. Defaults to 'me', which is the currently logged in user.
-
-
-=head2 set_message ( message )
-
-Sets the body text of the note.
-
-=head3 message
-
-A string of text.
-
-
-=head2 set_subject ( subject )
-
-Sets the title to identify the note from others.
-
-=head3 subject
-
-A string of text.
-
-
-
-=head2 publish ( )
-
-Posts the data and returns a L<Facebook::Graph::Response> object. The response object should contain the id:
-
- {"id":"1647395831_130068550371568"}
-
-=head1 LEGAL
-
-Facebook::Graph is Copyright 2010 - 2012 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
-
-=cut
@@ -1,6 +1,6 @@
 package Facebook::Graph::Publish::PageTab;
-$Facebook::Graph::Publish::PageTab::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::PageTab::VERSION = '1.1000';
+use Moo;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/tabs';
@@ -17,8 +17,7 @@ around get_post_params => sub {
     return $post;
 };
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 
 =head1 NAME
@@ -27,7 +26,7 @@ Facebook::Graph::Publish::PageTab - Add a page tab.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,6 +1,6 @@
 package Facebook::Graph::Publish::Photo;
-$Facebook::Graph::Publish::Photo::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::Photo::VERSION = '1.1000';
+use Moo;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/photos';
@@ -56,8 +56,7 @@ around get_post_params => sub {
     return $self->has_url ? $post : ( Content_Type => 'form-data', Content => $post );
 };
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 =head1 NAME
 
@@ -65,7 +64,7 @@ Facebook::Graph::Publish::Photo - Publish Photos
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,6 +1,7 @@
 package Facebook::Graph::Publish::Post;
-$Facebook::Graph::Publish::Post::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::Post::VERSION = '1.1000';
+use Moo;
+use Ouch;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/feed';
@@ -79,7 +80,7 @@ has target_countries => (
     is          => 'rw',
     default     => sub {[]},
     lazy        => 1,
-    isa         => 'ArrayRef',
+    isa         => sub { ouch(442,"$_[0] is not an Array Reference") unless ref $_[0] eq 'ARRAY' },
     predicate   => 'has_target_countries',
 );
 
@@ -93,7 +94,7 @@ has target_cities => (
     is          => 'rw',
     default     => sub {[]},
     lazy        => 1,
-    isa         => 'ArrayRef',
+    isa         => sub { ouch(442,"$_[0] is not an Array Reference") unless ref $_[0] eq 'ARRAY' },
     predicate   => 'has_target_cities',
 );
 
@@ -107,7 +108,7 @@ has target_regions => (
     is          => 'rw',
     default     => sub {[]},
     lazy        => 1,
-    isa         => 'ArrayRef',
+    isa         => sub { ouch(442,"$_[0] is not an Array Reference") unless ref $_[0] eq 'ARRAY' },
     predicate   => 'has_target_regions',
 );
 
@@ -121,7 +122,7 @@ has target_locales => (
     is          => 'rw',
     default     => sub {[]},
     lazy        => 1,
-    isa         => 'ArrayRef',
+    isa         => sub { ouch(442,"$_[0] is not an Array Reference") unless ref $_[0] eq 'ARRAY' },
     predicate   => 'has_target_locales',
 );
 
@@ -146,7 +147,7 @@ has actions => (
     is          => 'rw',
     default     => sub {[]},
     lazy        => 1,
-    isa         => 'ArrayRef',
+    isa         => sub { ouch(442,"$_[0] is not an Array Reference") unless ref $_[0] eq 'ARRAY' },
     predicate   => 'has_actions',
 );
 
@@ -171,7 +172,7 @@ has privacy => (
 
 has privacy_options => (
     is          => 'rw',
-    isa         => 'HashRef',
+    isa         => sub { ouch(442,"$_[0] is not an Array Reference") unless ref $_[0] eq 'HASH' },
     default     => sub {{}},
 );
 
@@ -234,10 +235,7 @@ around get_post_params => sub {
     return $post;
 };
 
-
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -245,7 +243,7 @@ Facebook::Graph::Publish::Post - Publish to a user's wall.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,13 +1,11 @@
 package Facebook::Graph::Publish::RSVPAttending;
-$Facebook::Graph::Publish::RSVPAttending::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::RSVPAttending::VERSION = '1.1000';
+use Moo;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/attending';
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -15,7 +13,7 @@ Facebook::Graph::Publish::RSVPAttending - RSVP attending to an event.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,13 +1,11 @@
 package Facebook::Graph::Publish::RSVPDeclined;
-$Facebook::Graph::Publish::RSVPDeclined::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::RSVPDeclined::VERSION = '1.1000';
+use Moo;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/declined';
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -15,7 +13,7 @@ Facebook::Graph::Publish::RSVPDeclined - RSVP declined to an event.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,13 +1,11 @@
 package Facebook::Graph::Publish::RSVPMaybe;
-$Facebook::Graph::Publish::RSVPMaybe::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::RSVPMaybe::VERSION = '1.1000';
+use Moo;
 extends 'Facebook::Graph::Publish';
 
 use constant object_path => '/maybe';
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -15,7 +13,7 @@ Facebook::Graph::Publish::RSVPMaybe - RSVP maybe to an event.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,6 +1,6 @@
 package Facebook::Graph::Publish;
-$Facebook::Graph::Publish::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Publish::VERSION = '1.1000';
+use Moo;
 use Facebook::Graph::Request;
 with 'Facebook::Graph::Role::Uri';
 use AnyEvent::HTTP::LWP::UserAgent;
@@ -40,14 +40,11 @@ sub get_post_params {
 sub publish {
     my ($self) = @_;
     my $uri = $self->uri;
-    $uri->path($self->object_name.$self->object_path);
+    $uri->path($self->generate_versioned_path($self->object_name.$self->object_path));
     return Facebook::Graph::Request->new->post($uri, $self->get_post_params)->recv;
 }
 
-
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -55,7 +52,7 @@ Facebook::Graph::Publish - A base class for publishing various things to faceboo
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 DESCRIPTION
 
@@ -1,6 +1,6 @@
 package Facebook::Graph::Query;
-$Facebook::Graph::Query::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Query::VERSION = '1.1000';
+use Moo;
 use Facebook::Graph::Request;
 with 'Facebook::Graph::Role::Uri';
 use URI::Escape;
@@ -63,7 +63,7 @@ has search_type => (
 
 has object_name => (
     is          => 'rw',
-    default     => '',
+    default     => sub {''},
 );
 
 has until => (
@@ -186,7 +186,7 @@ sub uri_as_string {
         $query{ids} = join(',', @{$self->ids});
     }
     my $uri = $self->uri;
-    $uri->path($self->object_name);
+    $uri->path($self->generate_versioned_path($self->object_name));
     $uri->query_form(%query);
     return $uri->as_string;
 }
@@ -196,9 +196,7 @@ sub request {
     return Facebook::Graph::Request->new->get($self->uri_as_string)->recv;
 }
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -206,7 +204,7 @@ Facebook::Graph::Query - Simple and fast searching and fetching of Facebook data
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,6 +1,6 @@
 package Facebook::Graph::Request;
-$Facebook::Graph::Request::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Request::VERSION = '1.1000';
+use Moo;
 use JSON;
 use Ouch;
 use AnyEvent::HTTP::LWP::UserAgent;
@@ -9,7 +9,7 @@ use Facebook::Graph::Response;
 
 has ua => (
     is      => 'rw',
-    isa     => 'AnyEvent::HTTP::LWP::UserAgent',
+    isa     => sub {ouch(442,"$_[0] is not an HTTP::Response object") unless ref $_[0] eq 'AnyEvent::HTTP::LWP::UserAgent'},
     lazy    => 1,
     default => sub {
         my $ua = AnyEvent::HTTP::LWP::UserAgent->new;
@@ -37,8 +37,7 @@ sub get {
     return $cv;
 }
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 =head1 NAME
 
@@ -46,7 +45,7 @@ Facebook::Graph::Request - Handling posts to Facebook Graph.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 DESCRIPTION
 
@@ -1,12 +1,12 @@
 package Facebook::Graph::Response;
-$Facebook::Graph::Response::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Response::VERSION = '1.1000';
+use Moo;
 use JSON;
 use Ouch;
 
 has response => (
     is      => 'rw',
-    isa     => 'HTTP::Response',
+    isa     => sub {ouch(442,"$_[0] is not an HTTP::Response object") unless ref $_[0] eq 'HTTP::Response'},
     required=> 1,
 );
 
@@ -48,8 +48,7 @@ has as_hashref => (
     },
 );
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 =head1 NAME
 
@@ -57,7 +56,7 @@ Facebook::Graph::Response - Handling of a Facebook::Graph response documents.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 DESCRIPTION
 
@@ -1,10 +1,20 @@
 package Facebook::Graph::Role::Uri;
-$Facebook::Graph::Role::Uri::VERSION = '1.0801';
-use Any::Moose 'Role';
+$Facebook::Graph::Role::Uri::VERSION = '1.1000';
+use Moo::Role;
 use URI;
 
 sub uri {
-    return URI->new('https://graph.facebook.com/v2.1')
+    return URI->new('https://graph.facebook.com')
+}
+
+has api_version => (
+    is  => 'rw',
+    default => 'v2.2',
+);
+
+sub generate_versioned_path {
+    my ($self, $path) = @_;
+    return join('/', $self->api_version, $path);
 }
 
 
@@ -16,7 +26,7 @@ Facebook::Graph::Role::Uri - The base URI for the Facebook Graph API.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 DESCRIPTION
 
@@ -1,6 +1,6 @@
 package Facebook::Graph::Session;
-$Facebook::Graph::Session::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::Session::VERSION = '1.1000';
+use Moo;
 use Facebook::Graph::Request;
 with 'Facebook::Graph::Role::Uri';
 
@@ -37,9 +37,7 @@ sub request {
     return Facebook::Graph::Request->new->get($self->uri_as_string)->recv;
 }
 
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
-
+1;
 
 =head1 NAME
 
@@ -48,7 +46,7 @@ Facebook::Graph::Session - Convert old API sessions into Graph API access_tokens
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
@@ -1,6 +1,6 @@
 package Facebook::Graph;
-$Facebook::Graph::VERSION = '1.0801';
-use Any::Moose;
+$Facebook::Graph::VERSION = '1.1000';
+use Moo;
 use MIME::Base64::URLSafe;
 use JSON;
 use Facebook::Graph::AccessToken;
@@ -13,9 +13,7 @@ use Facebook::Graph::Publish::Photo;
 use Facebook::Graph::Publish::Checkin;
 use Facebook::Graph::Publish::Like;
 use Facebook::Graph::Publish::Comment;
-use Facebook::Graph::Publish::Note;
 use Facebook::Graph::Publish::Link;
-use Facebook::Graph::Publish::Event;
 use Facebook::Graph::Publish::RSVPMaybe;
 use Facebook::Graph::Publish::RSVPAttending;
 use Facebook::Graph::Publish::RSVPDeclined;
@@ -113,11 +111,6 @@ sub fetch {
     return $self->query->find($object_name)->request->as_hashref;
 }
 
-sub fql {
-    my ($self, $query) = @_;
-    return $self->query->find('fql')->search($query)->request->as_hashref;
-}
-
 sub request {
     my ($self, $uri) = @_;
     return Facebook::Graph::Request->new->get($uri)->recv;
@@ -234,18 +227,6 @@ sub add_comment {
     return Facebook::Graph::Publish::Comment->new( %params );
 }
 
-sub add_note {
-    my ($self) = @_;
-    my %params = ( );
-    if ($self->has_access_token) {
-        $params{access_token} = $self->access_token;
-    }
-    if ($self->has_secret) {
-        $params{secret} = $self->secret;
-    }
-    return Facebook::Graph::Publish::Note->new( %params );
-}
-
 sub add_link {
     my ($self) = @_;
     my %params = ( );
@@ -258,21 +239,6 @@ sub add_link {
     return Facebook::Graph::Publish::Link->new( %params );
 }
 
-sub add_event {
-    my ($self, $object_name) = @_;
-    my %params = ( );
-    if ($object_name) {
-        $params{object_name} = $object_name;
-    }
-    if ($self->has_access_token) {
-        $params{access_token} = $self->access_token;
-    }
-    if ($self->has_secret) {
-        $params{secret} = $self->secret;
-    }
-    return Facebook::Graph::Publish::Event->new( %params );
-}
-
 sub add_page_tab {
     my ($self, $object_name, $app_id) = @_;
 
@@ -339,9 +305,7 @@ sub rsvp_declined {
 }
 
 
-
-no Any::Moose;
-__PACKAGE__->meta->make_immutable;
+1;
 
 =head1 NAME
 
@@ -349,18 +313,19 @@ Facebook::Graph - A fast and easy way to integrate your apps with Facebook.
 
 =head1 VERSION
 
-version 1.0801
+version 1.1000
 
 =head1 SYNOPSIS
 
  my $fb = Facebook::Graph->new;
- my $sarah_bownds = $fb->fetch('sarahbownds');
+ $fb->access_token($token);
+ my $sarah_bownds = $fb->fetch('767598108');
  my $perl_page = $fb->fetch('16665510298');
 
 Or better yet:
 
  my $sarah_bownds = $fb->query
-    ->find('sarahbownds')
+    ->find('767598108')
     ->include_metadata
     ->select_fields(qw( id name picture ))
     ->request
@@ -370,14 +335,14 @@ Or better yet:
 
 You can also do asynchronous calls like this:
 
- my $sarah = $fb->query->find('sarahbownds'); 		# making request in background here
+ my $sarah = $fb->query->find('767598108'); 		# making request in background here
  # ... do stuff here ...
  my $hashref = $sarah->as_hashref;			# handling the response here
 
 
 Or fetching a response from a URI you already have:
 
- my $hashref = $fb->request('https://graph.facebook.com/btaylor')->as_hashref;
+ my $hashref = $fb->request('https://graph.facebook.com/16665510298')->as_hashref;
 
 
 =head2 Building A Privileged App
@@ -418,7 +383,7 @@ Get some info:
 
  my $user = $fb->fetch('me');
  my $friends = $fb->fetch('me/friends');
- my $sarah_bownds = $fb->fetch('sarahbownds');
+ my $perl_page = $fb->fetch('16665510298');
 
 =head1 DESCRIPTION
 
@@ -486,6 +451,10 @@ An authorization code string that you should have gotten by going through the C<
 
 Creates a L<Facebook::Graph::Query> object, which can be used to fetch and search data from Facebook.
 
+=head2 batch_requests ( uri )
+
+Creates a L<Facebook::Graph::BatchRequests> object, which can be used to send multiple requests in a single HTTP request.
+
 =head2 request ( uri )
 
 Fetch a Facebook::Graph URI you already have.
@@ -498,14 +467,13 @@ The URI to fetch. For example: https://graph.facebook.com/amazon
 
 Returns a hash reference of an object from facebook. A quick way to grab an object from Facebook. These two statements are identical:
 
- my $sarah = $fb->fetch('sarahbownds');
+ my $sarah = $fb->fetch('767598108');
 
- my $sarah = $fb->query->find('sarahbownds')->request->as_hashref;
+ my $sarah = $fb->query->find('767598108')->request->as_hashref;
 
 =head3 id
 
-An profile id like C<sarahbownds> or an object id like C<16665510298> for the Perl page.
-
+An object id like C<16665510298> for the Perl page.
 
 =head2 picture ( id )
 
@@ -513,7 +481,7 @@ Returns a L<Facebook::Graph::Picture> object, which can be used to generate the
 
 =head3 id
 
-An profile id like C<sarahbownds> or an object id like C<16665510298> for the Perl page.
+An object id like C<16665510298> for the Perl page.
 
 
 
@@ -521,6 +489,10 @@ An profile id like C<sarahbownds> or an object id like C<16665510298> for the Pe
 
 Creates a L<Facebook::Graph::Publish::Post> object, which can be used to publish data to a user's feed/wall.
 
+=head2 add_page_feed ( )
+
+Creates a L<Facebook::Graph::Page::Feed> object, which can be used to add a post to a Facebook page.
+
 =head2 add_photo ( [ id ] )
 
 Creates a L<Facebook::Graph::Publish::Photo> object, which can be used to publish a photo to a user's feed/wall.
@@ -557,20 +529,11 @@ Creates a L<Facebook::Graph::Publish::Comment> object that you can use to commen
 The id of the post you want to comment on.
 
 
-=head2 add_note ( )
-
-Creates a L<Facebook::Graph::Publish::Note> object, which can be used to publish notes.
-
-
 =head2 add_link ( )
 
 Creates a L<Facebook::Graph::Publish::Link> object, which can be used to publish links.
 
 
-=head2 add_event ( [id] )
-
-Creates a L<Facebook::Graph::Publish::Event> object, which can be used to publish events.
-
 =head2 add_page_tab ( page_id, app_id )
 
 Creates a L<Facebook::Graph::Publish::PageTab> object, which can be used to publish an app as a page tab.
@@ -649,15 +612,16 @@ This module throws exceptions when it encounters a problem. It uses L<Ouch> to t
    throw $@; # rethrow the error
  }
 
+=head1 CAVEATS
 
-=head1 TODO
+The Facebook Graph API is a constantly moving target. As such some stuff that used to work, may stop working. Keep up to date with their changes here: L<https://developers.facebook.com/docs/apps/upgrading>
 
-I still need to add publishing albums/photos, deleting of content, impersonation, and analytics to have a feature complete API. In addition, the module could use a lot more tests.
+If you were using any version of Facebook::Graph before 1.1000, then you may be used to doing things like creating events through this API, or using a person's username instead of their ID, or making queries without an access token. You can't do any of those things anymore, because as of the Facebook Graph v2.0 API, none of them is supported any longer. 
 
 
 =head1 PREREQS
 
-L<Any::Moose>
+L<Moo>
 L<JSON>
 L<AnyEvent::HTTP::LWP::UserAgent>
 L<URI>
@@ -687,7 +651,8 @@ L<http://github.com/rizen/Facebook-Graph/issues>
 
 =head1 SEE ALSO
 
-If you're looking for a fully featured Facebook client in Perl I highly recommend L<WWW::Facebook::API>. It does just about everything, it just uses the old Facebook API.
+I highly recommend L<Facebook::OpenGraph>. I may even switch to it myself soon.
+
 
 =head1 AUTHOR
 
@@ -0,0 +1,13 @@
+use Test::More tests => 5;
+use lib '../lib';
+
+use_ok('Facebook::Graph');
+my $fb = Facebook::Graph->new;
+isa_ok($fb, 'Facebook::Graph');
+
+my $sarah = $fb->query->find('sarahbownds');
+
+is $sarah->object_name, 'sarahbownds', 'get the proper object name';
+is $sarah->api_version, 'v2.2', 'get an api version';
+is $sarah->generate_versioned_path('sarahbownds'), 'v2.2/sarahbownds', 'create a versioned api path';
+
@@ -1,13 +0,0 @@
-use Test::More tests => 4;
-use lib '../lib';
-
-use_ok('Facebook::Graph');
-my $fb = Facebook::Graph->new;
-isa_ok($fb, 'Facebook::Graph');
-
-my $sarah = $fb->fetch('sarahbownds');
-ok(ref $sarah eq 'HASH', 'got a hash ref back');
-is($sarah->{id}, '767598108', 'got sarah');
-
-use Data::Dumper;
-note Dumper $sarah;
@@ -1,38 +0,0 @@
-use Test::More tests => 16;
-use lib '../lib';
-use Ouch;
-
-use_ok('Facebook::Graph');
-my $fb = Facebook::Graph->new;
-isa_ok($fb, 'Facebook::Graph');
-
-my $sarah_query = $fb->query
-    ->find('sarahbownds')
-    ->select_fields(qw(name id))
-    ->include_metadata;
-isa_ok($sarah_query, 'Facebook::Graph::Query');
-my $got = URI->new($sarah_query->uri_as_string);
-is($got->scheme, 'https', 'scheme of generated uri');
-is($got->host, 'graph.facebook.com', 'host of generated uri');
-is($got->path, '/sarahbownds', 'path of generated uri');
-my %query = $got->query_form;
-is_deeply(\%query, {fields => 'name,id', metadata => '1'}, 'query of generated uri');
-
-my $sarah_response = $sarah_query->request;
-isa_ok($sarah_response, 'Facebook::Graph::Response');
-my $sarah = eval{$sarah_response->as_hashref};
-
-die $@->[1] if $@;
-
-ok(ref $sarah eq 'HASH', 'got a hash ref back');
-is($sarah->{id}, '767598108', 'got sarah');
-is($sarah->{name}, 'Sarah Bownds', 'know her name');
-is(scalar(keys %{$sarah}), 3, 'only fetched the things i asked for');
-is($sarah->{metadata}{type}, 'user', 'she is a user');
-
-eval { $fb->query->select_fields('')->request->as_json };
-is($@->code, 400, 'exception inherits http status code');
-like($@->message, qr#^\QCould not execute request (https://graph.facebook.com?fields=): GraphMethodException - Unsupported get request.\E#, 'exception gives good detail');
-
-is $fb->request('https://graph.facebook.com/amazon')->as_hashref->{username}, 'Amazon', 'can directly fetch a facebook graph url' ;
-
@@ -8,7 +8,7 @@ isa_ok($fb, 'Facebook::Graph');
 my $sarah_pic = $fb->picture('sarahbownds');
 isa_ok($sarah_pic, 'Facebook::Graph::Picture');
 
-is($sarah_pic->uri_as_string, 'https://graph.facebook.com/sarahbownds/picture', 'default pic');
-is($sarah_pic->get_small->uri_as_string, 'https://graph.facebook.com/sarahbownds/picture?type=small', 'small pic');
-is($sarah_pic->get_large->uri_as_string, 'https://graph.facebook.com/sarahbownds/picture?type=large', 'large pic');
-is($sarah_pic->get_square->uri_as_string, 'https://graph.facebook.com/sarahbownds/picture?type=square', 'square pic');
+is($sarah_pic->uri_as_string, 'https://graph.facebook.com/v2.2/sarahbownds/picture', 'default pic');
+is($sarah_pic->get_small->uri_as_string, 'https://graph.facebook.com/v2.2/sarahbownds/picture?type=small', 'small pic');
+is($sarah_pic->get_large->uri_as_string, 'https://graph.facebook.com/v2.2/sarahbownds/picture?type=large', 'large pic');
+is($sarah_pic->get_square->uri_as_string, 'https://graph.facebook.com/v2.2/sarahbownds/picture?type=square', 'square pic');