User:AnomieBOT/source/d/IWNS.pm/doc

NAME
d::IWNS - AnomieBOT decorator for Interwiki and Namespace mappings

SYNOPSIS
use AnomieBOT::API; $api = new AnomieBOT::API('conf.ini', 1); $api->decorators(qw/d::IWNS/);

DESCRIPTION
contains functions to load the interwiki, interlanguage, and namespace mappings. When "d::IWNS" is used as a decorator on the API object, the following methods are available.

METHODS PROVIDED

 * $api->load_IWNS_maps
 * Loads the data for the functions below from the wiki. Returns a true value on success, undef on error.


 * $api->interlanguage_map
 * Loads the interlanguage prefixes from the wiki. Returns a hash mapping prefixes to languages, or undef on error.


 * $api->interlanguage_re
 * Returns a regex matching all interlanguage prefixes, or undef on error.


 * $api->interwiki_map
 * $api->interwiki_map( $local_only )
 * Loads the interwiki prefixes from the wiki. Returns a hash mapping prefixes to URLs, or undef on error.


 * $api->interwiki_re
 * $api->interwiki_re( $local_only )
 * Returns a regex matching all interwiki prefixes, or undef on error.


 * $api->namespace_map
 * Loads the namespace prefixes from the wiki. Returns a hash mapping names to namespace numbers, or undef on error.


 * $api->namespace_aliases
 * Loads the namespace prefixes from the wiki. Returns a hash mapping canonical names to aliases, or undef on error.


 * $api->namespace_reverse_map
 * $api->namespace_reverse_map( $all )
 * Loads the namespace prefixes from the wiki. Returns a hash mapping numbers to canonical names, or numbers to the array of all names if $all is true, or undef on error.


 * $api->namespace_re
 * $api->namespace_re( @ns )
 * Returns a regex matching all namespace prefixes, or only the namespace prefixes whose numbers are in . Returns undef on error.


 * $api->namespace_re( '!', @ns )
 * Returns a regex matching the namespace prefixes whose numbers are not listed in . Returns undef on error.

COPYRIGHT
Copyright 2010–2019 Anomie

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.