The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CMS::MediaWiki - Perl extension for creating and updating MediaWiki pages

SYNOPSIS

  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
  );

DESCRIPTION

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.

Login example

        $rc = $mw->login( user => 'Reto', pass => 'yourpass' );

Another login example

        $rc = $mw->login(
                host => 'localhost' ,  # optional here, but wins if (re-)set here
                path => 'wiki',        # optional here, but wins
                user => 'Reto' ,
                pass => 'yourpass' ,
        );

Edit a Wiki page

        $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.

Tip

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";

EXPORT

None by default.

SEE ALSO

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

AUTHOR

Reto Schär, <retoh@cpan.org>

COPYRIGHT AND LICENSE

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:

Around line 303:

Non-ASCII character seen before =encoding in 'Schär,'. Assuming UTF-8