Etherpad

 view release on metacpan or  search on metacpan

lib/Etherpad.pm  view on Meta::CPAN

    }
  );

  $ec->create_pad('new_pad_name');

=head1 DESCRIPTION

Client module for the Etherpad HTTP API.

The Etherpad API currently supported is the 1.2.13 (Etherpad version: 1.6.0)

This module aims to replace L<Etherpad::API>

=head1 ATTRIBUTES

L<Etherpad> implements the following attributes.

=head2 url

  my $url = $ec->url;
  $ec     = $ec->url('http://pad.example.org');

MANDATORY. The Etherpad URL, no default.

=head2 apikey

  my $apikey = $ec->apikey;
  $ec        = $ec->apikey('secret_etherpad_API_key');

MANDATORY. Secret API key, located in the APIKEY.txt file of your Etherpad installation directory, no default.

=head2 ua

  my $ua = $ec->ua;
  $ec    = $ec->ua(Mojo::UserAgent->new);

OPTIONAL. User agent, default to a Mojo::UserAgent. Please, don't use anything other than a Mojo::Useragent.

=head2 user

  my $user = $ec->user;
  $ec      = $ec->user('bender');

OPTIONAL. HTTP user, use it if your Etherpad is protected by a HTTP authentication, no default.

=head2 password

  my $password = $ec->password;
  $ec          = $ec->password('beer');

OPTIONAL. HTTP password, use it if your Etherpad is protected by a HTTP authentication, no default.

=head2 proxy

  my $proxy = $ec->proxy;
  $ec       = $ec->proxy({
    http  => 'http://proxy.example.org',
    https => 'http://proxy.example.org'
  });

OPTIONAL. Proxy settings. If set to { detect => 1 }, Etherpad will check environment variables HTTP_PROXY, http_proxy, HTTPS_PROXY, https_proxy, NO_PROXY and no_proxy for proxy information. No default.

=head1 METHODS

Etherpad inherits all methods from Mojo::Base and implements the following new ones.

=head2 Groups

Pads can belong to a group. The padID of grouppads is starting with a groupID like g.asdfasdfasdfasdf$test

See L<https://etherpad.org/doc/v1.6.0/#index_groups>

=head3 create_group

 Usage     : $ec->create_group();
 Purpose   : Creates a new group
 Returns   : The new group ID
 Argument  : None
 See       : https://etherpad.org/doc/v1.6.0/#index_creategroup

=head3 create_group_if_not_exists_for

 Usage     : $ec->create_group_if_not_exists_for('groupMapper');
 Purpose   : This functions helps you to map your application group ids to epl group ids
 Returns   : The epl group id
 Argument  : Your application group id
 See       : https://etherpad.org/doc/v1.6.0/#index_creategroupifnotexistsfor_groupmapper

=head3 delete_group

 Usage     : $ec->delete_group('groupId');
 Purpose   : Deletes a group
 Returns   : 1 if it succeeds
 Argument  : The id of the group you want to delete
 See       : https://etherpad.org/doc/v1.6.0/#index_deletegroup_groupid

=head3 list_pads

 Usage     : $ec->list_pads('groupId');
 Purpose   : Returns all pads of this group
 Returns   : An array or an array reference (depending on the context) which contains the pad ids
 Argument  : The id of the group from which you want the pads
 See       : https://etherpad.org/doc/v1.6.0/#index_listpads_groupid

=head3 create_group_pad

 Usage     : $ec->create_group_pad('groupID', 'padName' [, 'text'])
 Purpose   : Creates a new pad in this group
 Returns   : 1 if it succeeds
 Argument  : The group id, the pad name, optionally takes the pad's initial text
 See       : https://etherpad.org/doc/v1.6.0/#index_creategrouppad_groupid_padname_text

=head3 list_all_groups

 Usage     : $ec->list_all_groups()
 Purpose   : Lists all existing groups
 Returns   : An array or an array reference (depending on the context) which contains the groups ids
 Argument  : None
 See       : https://etherpad.org/doc/v1.6.0/#index_listallgroups

=head2 Author



( run in 1.399 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )