Net::Social::Service::Facebook - a Facebook plugin for Net::Social
For reading Net::Social::Service::Facebook needs
You need an API key from Facebook. You can read how to get one from here
http://developers.facebook.com/get_started.php
See below.
I use this script
#!perl -w use strict; use WWW::Facebook::API; my $api_key = shift || die "You must pass an api key\n"; # get these when you sign up my $secret = shift || die "You must pass an api secret"; # as a facebook developer my $client = make_client($api_key, $secret); # Now get the auth token print "1) Go to ".$client->get_infinite_session_url."\n"; print "2) Press 'Generate' and get token\n"; print "3) Enter the token now\n"; chomp(my $token = <>); # Get a session $client->auth->get_session($token); $session_key = $client->session_key; $session_secret = $client->secret; # And note the session key print "4) Your infinite session key is $session_key\n"; print "5) Your infinite session secret is $session_secret\n"; # Now make a new client and set the session key again to see that it works my $new_client = make_client($api_key, $session_secret); $new_client->session_key($session_key); # And get my friends my $friends = $new_client->users->get_info( uids => $new_client->friends->get, fields => 'name'); print join("\n", map { $_->{name} } @$friends)."\n"; sub make_client { my ($api_key, $secret) = @_; my $client = WWW::Facebook::API->new( parse => 1, throw_errors => 1, ); $client->api_key($api_key); $client->secret($secret); $client->desktop(1); return $client; }
Returns your friends. It defines the keys uid, name and type.
uid
name
type
Simon Wistow <simon@thegestalt.org>
Copyright, 2007 - Simon Wistow
Distributed under the same terms as Perl itself
2 POD Errors
The following errors were encountered while parsing the POD:
Unknown directive: =over4
'=item' outside of any '=over'
To install Net::Social::Service::Facebook, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Social::Service::Facebook
CPAN shell
perl -MCPAN -e shell install Net::Social::Service::Facebook
For more information on module installation, please visit the detailed CPAN module installation guide.