Permalink
Browse files

updated copyright year, and added recipe #3

  • Loading branch information...
1 parent 5b70a7a commit d07cd2e634eee4c6303a7843076461f936539ca2 @rizen committed May 7, 2012
View
3 Changes
@@ -1,3 +1,6 @@
+1.0401 2012-05-07
+ - Added impersonation recipe.
+
1.0400 2012-04-11
- Added a date format option to find. Thanks to jwieland.
- Added better FQL handling. Thanks to vielmath.
View
2 dist.ini
@@ -3,7 +3,7 @@ author = JT Smith <jt@plainblack.com>
license = Perl_5
copyright_holder = Plain Black Corporation
copyright_year = 2012
-version = 1.0400
+version = 1.0401
[@Classic]
View
2 lib/Facebook/Graph.pm
@@ -609,7 +609,7 @@ JT Smith <jt_at_plainblack_dot_com>
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/AccessToken.pm
@@ -85,6 +85,6 @@ Makes a request to Facebook to fetch an access token. Returns a L<Facebook::Grap
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/AccessToken/Response.pm
@@ -67,7 +67,7 @@ Direct access to the L<HTTP::Response> object.
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Authorize.pm
@@ -107,6 +107,6 @@ Returns a URI string to redirect the user back to Facebook.
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
10 lib/Facebook/Graph/Cookbook.pod
@@ -10,19 +10,23 @@ The goal of this document is to provide a set of common recipies for success. Th
=over
-=item L<Facebook::Graph::Cookbook::Recipe1>
+=item L<Facebook::Graph::Cookbook::Recipe1> - Privileged App
Shows you how to set up a privileged application using nothing more than L<Plack>. This is very much a step by step tutorial.
-=item L<Facebook::Graph::Cookbook::Recipe2>
+=item L<Facebook::Graph::Cookbook::Recipe2> - Working Example
A fully functional Facebook::Graph app that publishes data to Facebook and reads data from it. Uses a full application server and lots of other modules. This is a working example, without a lot of explaination.
+=item L<Facebook::Graph::Cookbook::Recipe3> - Impersonation
+
+Shows you how to post as all the different pages under your control.
+
=back
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
4 lib/Facebook/Graph/Cookbook/Recipe1.pod
@@ -199,6 +199,6 @@ For more recipes, check out the L<Facebook::Graph::Cookbook>.
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
+=cut
View
2 lib/Facebook/Graph/Cookbook/Recipe2.pod
@@ -95,6 +95,6 @@ For more recipes, check out the L<Facebook::Graph::Cookbook>.
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
56 lib/Facebook/Graph/Cookbook/Recipe3.pod
@@ -0,0 +1,56 @@
+=head1 NAME
+
+Facebook::Graph::Cookbook::Recipe3 - Impersonation
+
+=head1 DESCRIPTION
+
+Building an application that can post as another page under my control.
+
+=head2 Assumptions
+
+We're assuming you've already learned the basics of Facebook::Graph through the other recipies and have already set up your application access token.
+
+=head1 RECIPE
+
+ use Facebook::Graph;
+ use Ouch;
+ use Config::JSON;
+
+ # init
+ my $fb_config = Config::JSON->new('/path/to/my.conf')->get('facebook');
+ my $fb = Facebook::Graph->new($fb_config);
+
+ # get list of available my pages and access tokens
+ my $pages = $fb->query->find('me/accounts')->include_metadata->request->as_hashref->{data};
+ my $token;
+
+ # identify the specific page i want to post to
+ foreach my $page (@{$pages}) {
+ $token = $page->{access_token} if $page->{id} eq $fb_config->{page_id};
+ }
+ unless (defined $token) {
+ ouch 504, "Couldn't post to Facebook.";
+ }
+
+ # post
+ $fb->access_token($token);
+ my $response_id = $fb->add_post
+ ->set_message($message);
+ ->set_link_name($link_name)
+ ->set_link_uri($link_uri)
+ ->set_link_description($link_description)
+ ->set_picture_uri($picture_uri)
+ ->publish
+ ->as_hashref
+ ->{id};
+
+
+=head1 SEE ALSO
+
+For more recipes, check out the L<Facebook::Graph::Cookbook>.
+
+=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
View
2 lib/Facebook/Graph/Picture.pm
@@ -110,6 +110,6 @@ Returns a URI string based upon all the methods you've called so far on the quer
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish.pm
@@ -67,6 +67,6 @@ This module shouldn't be used by you directly for any purpose.
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/Checkin.pm
@@ -177,6 +177,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/Comment.pm
@@ -71,6 +71,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/Event.pm
@@ -183,6 +183,6 @@ Add venue and privacy as described on L<http://developers.facebook.com/docs/refe
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/Like.pm
@@ -35,6 +35,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/Link.pm
@@ -100,6 +100,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/Note.pm
@@ -100,6 +100,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/Photo.pm
@@ -73,6 +73,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/Post.pm
@@ -467,6 +467,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/RSVPAttending.pm
@@ -35,6 +35,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/RSVPDeclined.pm
@@ -35,6 +35,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Publish/RSVPMaybe.pm
@@ -35,6 +35,6 @@ Posts the data and returns a L<Facebook::Graph::Response> object. The response o
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Query.pm
@@ -424,6 +424,6 @@ Optionally pass in your own URI string and all the other options will be ignored
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Response.pm
@@ -81,7 +81,7 @@ Direct access to the L<HTTP::Response> object.
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Role/Uri.pm
@@ -20,7 +20,7 @@ Provides a C<uri> method in any class which returns a L<URI> object that points
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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
View
2 lib/Facebook/Graph/Session.pm
@@ -79,6 +79,6 @@ Makes a request to Facebook to fetch an access token. Returns a L<Facebook::Grap
=head1 LEGAL
-Facebook::Graph is Copyright 2010 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
+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

0 comments on commit d07cd2e

Please sign in to comment.