Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- # autoflush the output by turning buffering off
- $|++;
- use strict;
- use warnings;
- use WWW::Mechanize;
- my $uid = 'UUID';
- my $pass = 'PASS';
- my $url = 'https://my.xsusenet.com/index.php';
- my $mech = WWW::Mechanize->new( agent => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36' );
- $mech->get($url);
- my @forms = $mech->forms;
- $mech->set_fields (
- 'username' => $uid,
- 'password' => $pass );
- my $resp = $mech->submit();
- my $status = $mech->status();
- if ($status == 200) {
- my $unpause = $mech->find_link( url_abs_regex => qr{unpause} );
- if (defined $unpause){
- my $renew = 'https://my.xsusenet.com/'.$unpause->url;
- $mech->get($renew);
- $status = $mech->status();
- #print "Account renewed\n";
- }
- }else{
- die "Recieved an invalid status response: $status\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment