PageRenderTime 34ms CodeModel.GetById 23ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/3.1/misc/Login.pl

http://perlwikipedia.googlecode.com/
Perl | 45 lines | 22 code | 21 blank | 2 comment | 0 complexity | 0311b377eb746069ffd796d2616ce91f MD5 | raw file
Possible License(s): GPL-3.0
 1#!/usr/bin/perl -w
 2
 3use Term::ReadKey;
 4use Perlwikipedia;
 5
 6print "\nPlease enter the username of the account you are logging in: ";
 7
 8my $username=<STDIN>;
 9
10chomp $username;
11
12print "\nPlease enter the password of the account: ";
13
14ReadMode('noecho');
15
16my $password=ReadLine(0);
17
18chomp $password;
19
20ReadMode('normal');
21
22my $perlwikipedia=Perlwikipedia->new($username);
23
24# Turn debugging on, to see what the bot is doing
25$perlwikipedia->{debug} = 1;
26
27print "\nPlease enter the host of the wiki, such as \'en.wikipedia.org\': ";
28
29my $host=<STDIN>;
30
31chomp $host;
32
33print "\nPlease enter the path to index.php, such as \'w\' on Wikipedia: ";
34
35my $path=<STDIN>;
36
37chomp $path;
38
39$perlwikipedia->set_wiki($host, $path);
40
41print "\nTrying to log in...";
42
43my $login_status=$perlwikipedia->login($username, $password);
44
45print "\nLogin returned \'$login_status\'\n";