MediaWiki::DumpFile::Pages - Process an XML dump file of pages from a MediaWiki instance
use MediaWiki::DumpFile::Pages; $pages = MediaWiki::DumpFile::Pages->new($file); $pages = MediaWiki::DumpFile::Pages->new(\*FH); while(defined($page = $pages->next) { print 'Title: ', $page->title, "\n"; print 'Text: ', $page->revision->text, "\n"; }
This is the constructor for this package. It is called with a single parameter: the location of a MediaWiki pages dump file or a reference to an already open file handle.
Returns an instance of MediaWiki::DumpFile::Pages::Page or undef if there is no more pages available.
This object represents a distinct Mediawiki page and is used to access the page data and metadata. The following methods are available:
Returns a string of the page title
Returns a numerical page identification
In scalar context returns the most recent revision data for this page; in array context returns a list of all revisions made available for the page in the same order as the dump file. All returned data is an instance of MediaWiki::DumpFile::Pages::Revision
This object represents a distinct revision of a page from the Mediawiki dump file. The standard dump files contain only the most specific revision of each page and the comprehensive dump files contain all revisions for each page. The following methods are available:
Returns the page text for this specific revision of the page.
Returns the numerical revision id for this specific revision - this is independent of the page id.
Returns a string value representing the time the revision was created. The string is in the format of "2008-07-09T18:41:10Z".
Returns the comment made about the revision when it was created.
To install MediaWiki::DumpFile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MediaWiki::DumpFile
CPAN shell
perl -MCPAN -e shell install MediaWiki::DumpFile
For more information on module installation, please visit the detailed CPAN module installation guide.