my $bot = MediaWiki::Bot->new( useragent => 'MediaWiki::Bot 2.3.1 (User:Mike.lifeguard)', assert => 'bot', protocol => 'https', host => 'wiki.eng.xxx.com', path => 'foo/bar', );
I missed it before - you haven't passed a hashref. Should be:
my $bot = MediaWiki::Bot->new({ protocol => 'https', host => 'wiki.eng.xxx.com', path => 'foo/bar', });
This is documented incorrectly in some places right now, another reason this shouldn't have been sent to CPAN yet. ARGH!
Hi Mike,
I have modified the constructor to accept a hashref and it returns instantly (like it did earlier). Is there a way to determine if this operation succeeded? Using Data::Dumper, I dumped out the contents of $bot but nothing in the output indicated that the login succeeded or failed. The doc for this module seems pretty sparse and the examples therein are not easy to use/adapt :(
#!/usr/bin/perl use strict; use warnings; use MediaWiki::Bot; my $pagename = "foo/bar"; my $bot = MediaWiki::Bot->new({ protocol => 'https', host => 'wiki.eng.xxx.com', # path => 'foo/bar', username => 'user', password => 'pass', } ); print "bot created\n"; my $text = $bot->get_text($pagename);
Running the above hangs right after the print is executed:
# perl bot.pl bot created
I don't have access to the server that runs the wiki to debug if this is a server side issue.
Do you have any working examples of connecting to a wiki page and performing simple tasks such as examining history of pages, editing them etc..?
Thanks, ravi