Net::Social - abstracted interface for social networks
use Net::Social qw(:all); # get constants # What services are available my @services = Net::Social->services; # Fetch a handler for a service my $service = Net::Social->service('LiveJournal'); # what fields are needed to login my %params = $service->params; foreach my $type (keys %params) { print "To $type:\n"; # either read or write foreach my $p (keys %$types{$type}) { print $params{$type}->{$p}->{name}." : ".$params{$type}->{$p}->{description}."\n"; # also 'required' and 'sensitive' } } # login - my_params must have the required fields from %params $service->login(%my_params); # now fetch your friends my @friends = $service->friends; # add a friend $service->add_friend($friend); # remove a friend $service->remove_friend($friend);
Optionally exports the constants
NONE FRIENDED FRIENDED_BY MUTUAL
Which describe the type of relationship with a friend.
It should be noted that
MUTUAL = FRIENDED | FRIENDED_BY;
but is provided for convenience.
A list of all services available.
Fetch the class for a given service
Returns undef if that service isn't found.
Simon Wistow <simon@thegestalt.org>
Copyright, 2007 - Simon Wistow
Distributed under the same terms as Perl itself
To install Net::Social, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Social
CPAN shell
perl -MCPAN -e shell install Net::Social
For more information on module installation, please visit the detailed CPAN module installation guide.