"Jools Smyth via RT" <bug-MediaWiki-API@rt.cpan.org> writes:
Show quoted textOK, thanks.
P.S., after doing what make uninstall said to clean up the non-deb 0.25, there was residue left:
# find /usr/local/lib/ -ctime -44
/usr/local/lib/
/usr/local/lib/perl
/usr/local/lib/perl/5.10.0
/usr/local/lib/perl/5.10.0/auto
/usr/local/lib/perl/5.10.0/auto/MediaWiki
/usr/local/lib/perl/5.10.0/auto/MediaWiki/API
/usr/local/lib/perl/5.10.0/perllocal.pod
# find /usr/local/share/perl/
/usr/local/share/perl/
/usr/local/share/perl/5.10.0
/usr/local/share/perl/5.10.0/MediaWiki
BTW:
Me accidentally setting
apnamespace=> $_
when $_ was not set caused
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/MediaWiki/API.pm line 713.
maybe you want to catch or ignore this...
Wait, via my accident, I discovered how to print all namespaces in one
command.
However, one line got repeated!!:
$ ./myapiscript|uniq --repeated
24 2 使用者:Wikia
$ cat myapiscript
#!/usr/bin/perl
use strict;
use warnings FATAL => q(all);
use MediaWiki::API;
use open qw/:std :encoding(utf8)/;
my $mw = MediaWiki::API->new();
$mw->{config}->{api_url} = '
http://taizhongbus.wikia.com/api.php';
$mw->{config}->{use_http_get} = 1;
$mw->{ua}->env_proxy;
my $articles = $mw->list(
{
action => 'query',
list => 'allpages',
apnamespace => '',
}
)
|| die $mw->{error}->{code} . ': ' . $mw->{error}->{details};
foreach ( @{$articles} ) {
print "$_->{pageid}\t$_->{ns}\t$_->{title}\n";
}