speer0

xsusenet auto renewal

Feb 12th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #!/usr/bin/env perl
  2.  
  3. # autoflush the output by turning buffering off
  4. $|++;
  5.  
  6. use strict;
  7. use warnings;
  8. use WWW::Mechanize;
  9.  
  10. my $uid = '';
  11. my $pass = '';
  12.  
  13. my $url = 'https://my.xsusenet.com/';
  14. my $mech = WWW::Mechanize->new( agent => 'Mozilla/5.0 (X11 Ubuntu Linux x86_64 rv 14.0) Gecko/20100101 Firefox/14.0.1' );
  15. $mech->cookie_jar(HTTP::Cookies->new());
  16. $mech->get($url);
  17. my @forms = $mech->forms;
  18. $mech->set_fields (
  19. 'email' => $uid,
  20. 'password' => $pass );
  21. my $resp = $mech->submit();
  22. my $status = $mech->status();
  23. my $output_page = $mech->content();
  24. while (defined $mech->find_link( url_abs_regex => qr{prolong}) && $status == 200) {
  25. $mech->follow_link(url_regex => qr/prolong/i);
  26. $status = $mech->status();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment