Advertisement
Guest User

Untitled

a guest
Feb 1st, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. use WWW::Mechanize;
  2. use utf8;
  3.  
  4. my $mech = WWW::Mechanize->new();
  5. my $username = "EMAIL\@EMAIL.com";
  6. my $password = "PASSWORD";
  7.  
  8. $mech->get("http://www.ancestry.com");
  9. my $r = $mech->submit_form(
  10. with_fields => {
  11. username => $username,
  12. password => $password,
  13. }
  14. );
  15.  
  16. $r->content =~ /http:\/\/www.ancestry.com(.*)\"\);/;
  17. my $redir_url = "http://www.ancestry.com" . $1;
  18.  
  19. my $o = $mech->get($redir_url);
  20. my $tresult = $mech->text();
  21.  
  22. if($tresult =~ /Too many people logged in/ig){
  23. print "Login failed due to another session with the specified user\n";
  24. die();
  25. }
  26.  
  27. if(!($tresult =~ "username or email")){
  28. print "LOGGED IN\n";
  29. }else{
  30. print "NOT LOGGED IN\n";
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement