Dokuwiki::Frontier::Client - A Frontier::Client for dokuwiki.
Dokuwiki::Frontier::Client extends the Frontier::Client with the Dokuwiki XML-RPC methods (without namespace) described in the dokuwiki xml-rpc page.
so the call to the wiki.getAllPages (which also require a call to dokuwiki.login) is like:
use Dokuwiki::Frontier::Client; use YAML (); my $client = Dokuwiki::Frontier::Client->base('https://di.u-strasbg.fr/') or die; $client->login('editor','s3cr3t') or die; print YAML::Dump [ $client->getAllPages ];
Note that base is just a shortcut for new. those constructions are equivalent:
base
new
Dokuwiki::Frontier::Client->base('https://di.u-strasbg.fr/'); Dokuwiki::Frontier::Client->base(url => 'https://di.u-strasbg.fr/'); Dokuwiki::Frontier::Client->new(url => 'https://di.u-strasbg.fr/lib/exe/xmlrpc.php' );
%Dokuwiki::Frontier::Client::API is a hash where keys are the Dokuwiki::Frontier::Client methods and values are the Dokuwiki XML-RPC methods. So you can have the list of the mapped functions with:
%Dokuwiki::Frontier::Client::API
Dokuwiki::Frontier::Client
perl -MDokuwiki::Frontier::Client -E'say for keys %Dokuwiki::Frontier::Client::API'
but please refer to the dokuwiki xml-rpc page for more details.
use Dokuwiki::Frontier::Client; use Modern::Perl; use Net::Netrc; use YAML; my $base = 'https://example.com/'; my $host = 'server.example.com'; my $wiki = Dokuwiki::Frontier::Client->base ( $host , debug => 1 ); my $credentials = Net::Netrc->lookup($host) or die "please add a fake $host machine in your ~/.netrc"; $wiki->login( ($credentials->lpa)[0,1] ) or die "can't authenticate"; say YAML::Dump [$wiki->getPage('/ficheappli/start')];
To install Dokuwiki::Frontier::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dokuwiki::Frontier::Client
CPAN shell
perl -MCPAN -e shell install Dokuwiki::Frontier::Client
For more information on module installation, please visit the detailed CPAN module installation guide.