CMS::MediaWiki - Perl extension for creating and updating MediaWiki pages
use CMS::MediaWiki; my $mw = CMS::MediaWiki->new( host => 'localhost', path => 'wiki' , # Can be empty on 3rd-level domain Wikis debug => 0 # 0=no debug msgs, 1=some msgs, 2=more msgs );
Create or update MediaWiki pages. An update of a MediaWiki page can also be reduced to a specific page section. You may update many pages with the same object handle ($mw in the shown example).
You could change the login name between an update. This might be necessary if you would like to update a public page *and* a protected page by the WikiSysop user in just one cycle.
$rc = $mw->login( user => 'Reto', pass => 'yourpass' );
$rc = $mw->login( host => 'localhost' , # optional here, but wins if (re-)set here path => 'wiki', # optional here, but wins user => 'Reto' , pass => 'yourpass' , );
$rc = $mw->editPage( title => 'Online_Directory:Computers:Software:Internet:Authoring' , section => '' , # 2 means edit second section etc. # '' = no section means edit the full page text => "== foo ==\nbar foo\n\n", summary => "Your summary." , );
In general, $rc returns 0 on success unequal 0 on failure.
After a successful call of the *editPage* function you had the following information available:
print "Edit time (before) was ", $mw->get('EDIT_TIME_BEFORE'), "\n"; print "Page title was " , $mw->get('PAGE_TITLE') , "\n"; print "The Wiki name was " , $mw->get('WIKI_NAME') , "\n";
None by default.
http://www.infocopter.com/perl/modules/
http://www.infocopter.com/know-how/cms.html
http://www.infocopter.com/know-how/mediawiki-reference/Perl-CMS-MediaWiki.html
Reto Schär, <retoh@cpan.org>
Copyright (C) 2005 by Reto Schär
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
http://www.infocopter.com/perl/licencing.html
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Schär,'. Assuming UTF-8
To install CMS::MediaWiki, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CMS::MediaWiki
CPAN shell
perl -MCPAN -e shell install CMS::MediaWiki
For more information on module installation, please visit the detailed CPAN module installation guide.