Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use WWW::Mechanize;
- use utf8;
- my $mech = WWW::Mechanize->new();
- my $username = "EMAIL\@EMAIL.com";
- my $password = "PASSWORD";
- $mech->get("http://www.ancestry.com");
- my $r = $mech->submit_form(
- with_fields => {
- username => $username,
- password => $password,
- }
- );
- $r->content =~ /http:\/\/www.ancestry.com(.*)\"\);/;
- my $redir_url = "http://www.ancestry.com" . $1;
- my $o = $mech->get($redir_url);
- my $tresult = $mech->text();
- if($tresult =~ /Too many people logged in/ig){
- print "Login failed due to another session with the specified user\n";
- die();
- }
- if(!($tresult =~ "username or email")){
- print "LOGGED IN\n";
- }else{
- print "NOT LOGGED IN\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement