Net::Social::Service - the base package for all the Net::Social plugins
my $service = Net::Social->service('LiveJournal');
or
my $service = Net::Social::Service::LiveJournal->new;
Get the params needed
my %params = Net::Social::Service::LiveJournal->params;
or my %params = $service->params;
for my $what (qw(read write)) { print "Can $what\n" if $params{$what}; } # list what keys are needed to login foreach my $key (keys %$params{read}) { print "$key: ".$params{read}->{$key}."\n"; }
then
$service->login(%params); foreach my $friend ($service->friends) { print "$friend->{name} $friend->{type}\n"; } $service->add_friend("frank"); $service->remove_friend("frank");
Create a new Service
What fields are needed to log in to this service.
This will return a hash ref, the keys of which will be either read or write or one of each. If you log in using the write params you will also be able to read.
read
write
Each of those will, in turn, be a hash ref the keys of which described what is needed. In turn their values will be another hash ref which can contain the fields
Always present. A description of the field.
Defaults to 0. Dictates whether this field is required or optional.
Defaults to 0. Whether or not this field is sensitive or not.
By sensitive we mean that it compromises the user's account. Examples of this might be, say, a password as opposed to a authorisation token.
This is a bit of a judgment call, to be honest.
Login in to this site.
All your friends on the site.
The friends will be return as a list of hash refs.
The hash refs will contain various fields depending on the service returning the data such as name (the person's full name), uid (the uid on the service), username (a username on the service, may be the same as uid). However each one will definitely contain type which will be one of 4 values, defined as constants in Net::Social.
name
uid
username
type
Net::Social
There's no defined relationship between the two of you.
You've friended them but they haven't friended you.
They've friended you but you haven't friended them.
You've both friended each other. MUTUAL is defined as
MUTUAL
MUTUAL = FRIENDED | FRIENDED_BY
In the future I may make all services return a key field or similar which will be the field needed for adding or deleting.
key
Add a friend.
Remove a friend.
3 POD Errors
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head2'
Unknown directive: =over4
'=item' outside of any '=over'
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.