From 727d9bea0598b9c31da25b9a7bf86fe26a93c9a8 Mon Sep 17 00:00:00 2001 From: Astrid Smith Date: Thu, 16 Sep 2010 20:14:01 -0700 Subject: Using MediaWiki::API now --- wikiscraper.pl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'wikiscraper.pl') diff --git a/wikiscraper.pl b/wikiscraper.pl index 6c62c4d..6126e71 100755 --- a/wikiscraper.pl +++ b/wikiscraper.pl @@ -5,6 +5,19 @@ use warnings; use strict; -require LWP::UserAgent; +require MediaWiki::API; + +my $api_url = shift @ARGV; +# http://wikiti.brandonw.net/api.php + +my $page = shift @ARGV; +# 83Plus:Ports:57 + +my $name = shift @ARGV; +my $password = shift @ARGV; + +my $mw = MediaWiki::API->new( { api_url => $api_url } ); +$mw->login( { lgname => $name, + lgpassword => $password } ) + || die $mw->{error}->{code} . ': ' . $mw->{error}->{details}; -my $wiki = shift @ARGV; -- cgit v1.2.3