Parse:...::page(3pm)
π Parse::MediaWikiDump::page β the manual page, bestie edition π
okay so this is Parse::MediaWikiDump::page(3pm) from the User Contributed Perl Documentation collection, and it's giving "one specific revision of a MediaWiki page, as an object" energy. let's get into it π
β¨ NAME β¨
Parse::MediaWikiDump::page β the object that represents one specific revision of a MediaWiki page. yeah. that's the whole vibe. π¦
πΈ ABOUT πΈ
so basically, you do not go out here and make these yourself, bestie. this object is returned to you from the next method of Parse::MediaWikiDump::Pages and Parse::MediaWikiDump::Revisions. π
you most likely will not be creating instances of this particular object yourself. instead you use this object to access the information about a page in a MediaWiki instance. that's the whole point. main character object behavior. π
β SYNOPSIS β
the classic. look at her:
$pages = Parse::MediaWikiDump::Pages->new('pages-articles.xml');
#get all the records from the dump files, one record at a time
while(defined($page = $pages->next)) {
print "title '", $page->title, "' id ", $page->id, "\n";
}
get all the records from the dump files, one record at a time. slay. π₯
π STATUS π
okay, not to be dramatic but β This software is being RETIRED. π
MediaWiki::DumpFile is the official successor to Parse::MediaWikiDump, and it ships with a compatibility library called MediaWiki::DumpFile::Compat that is 100% API compatible and is a near perfect standin for this module. it's faster in all instances where it counts, and it is actively maintained. π«Ά
and get this β any undocumented deviation of MediaWiki::DumpFile::Compat from Parse::MediaWikiDump is considered a bug and will be fixed. no cap. π
π§ METHODS π§
one bullet-list-of-methods per method, no skipping, we eat the whole plate π
$page->redirectβ returns an empty string (such as'') for the main namespace, or a string containing the name of the namespace. π$page->categoriesβ returns a reference to an array that contains a list of categories, orundefif there are no categories. heads up though: this method does not understand templates and may not return all the categories the article actually belongs in. π$page->titleβ returns a string of the full article title, including the namespace if present. π$page->namespaceβ returns a string of the namespace of the article, or an empty string if the article is in the default namespace. π$page->idβ returns a number that is the id for the page in the MediaWiki instance. π’$page->revision_idβ returns a number that is the revision id for the page in the MediaWiki instance. π§Ύ$page->timestampβ returns a string in the following format:2005-07-09T18:41:10Z. β°$page->usernameβ returns a string of the username responsible for this specific revision of the article, orundefif the editor was anonymous. π΅οΈ$page->useridβ returns a number that is the id for the user returned by$page->username, orundefif the editor was anonymous. π$page->useripβ returns a string of the IP of the editor if the edit was anonymous, orundefotherwise. π$page->minorβ returns1if this article was flaged as a minor edit, otherwise returns0. βοΈ$page->textβ returns a reference to a string that contains the article title text. π
and that's the whole page, bestie, you ate that π β¨
perl v5.36.0 Β· 2022-10-14 β mwah, go read the successor module, ily, bye ππ¦π
π¦ where this page comes from
- ubuntu noble: libparse-mediawikidump-perl 1.0.6-4 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu resolute: libparse-mediawikidump-perl 1.0.6-4 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu stonking: libparse-mediawikidump-perl 1.0.6-4 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms