Hello,
I have installed the bot and tried to run a basic script compiled from
the snippets in the documentation, but the editing does not happen. The
reading seems to work fine.
I tried under Windows/Strawberry Perl and in a VM under Debian/vanilla
Perl and I always get an error message from the code where the
'$bot->edit({' is located.
It always says
Error code 0: at
test.pl line xx.
I attach my script as well, feel free to play around with it as is. I am
an admin on that wiki and will change the bot credentials after a while.
I hope I only made a stupid error in the script since I really would
like to use Perl for some automated wiki updates.
#### script also attached for testing ####
#!/usr/bin/perl
use strict;
use warnings;
#use diagnostics -verbose;
# Include the MediaWiki::Bot methods in your script.
use MediaWiki::Bot qw(:constants);
#use MediaWiki::Bot;
# Username and password.
my $user = 'DS Census Bot';
my $pass = 'Afufihoda458';
#Create a Perlwikipedia object, and have it automatically log in and
configure itself
my $bot = MediaWiki::Bot->new({
assert => 'user',
protocol => 'https',
host => '
dcuniverseonline.wikia.com',
path => '',
operator => 'Datasentinel',
login_data => { username => $user, password => $pass },
debug => 1, # Turn debugging on, to see what the bot is doing
});
#Pull the wikitext of the Wikipedia Sandbox
my $article = 'Test Page - Ignore';
my $text = $bot->get_text($article);
# append something to the text
$text =~ s/Buying Price/Price Buying/g;
#control printout to screen
print $text;
#enable diagnostics;
print "before edit\n";
# Submit to Wikipedia.
# Note: This does not warn of edit conflicts, it just overwrites
existing text.
$bot->edit({
page => $article,
text => $text,
summary => 'A bot test edit',
minor => 1, # not a minor edit
});
#disable diagnostics;
print "after edit\n";
#### end of script ####
Link to the test page is
http://dcuniverseonline.wikia.com/wiki/Test_Page_-_Ignore
Regards,
Oliver Heidelbach
--
Am schwersten sind die Fragen zu beantworten, die wir uns deswegen gar
nicht erst stellen.
Michael Richter (deutscher Zeithistoriker)