Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/perl
use strict;
use YAML;
use WWW::Mechanize;
use Data::Dumper;
my $m= WWW::Mechanize->new(agent => 'WWW-Mechanize/1.34', cookie_jar => {});
$m->get( "https://www.linode.com/members" );
if($m->success()){
print "Got page... Logging in with [ $ENV{'LINODE_USERID'} : $ENV{'LINODE_PASSWD'} ]\n";
$m->submit_form(
with_fields => {
auth_username => "$ENV{'LINODE_USERID'}",
auth_password => "$ENV{'LINODE_PASSWD'}"
},
);
}
if($m->content()=~m/Login incorrect or session timed-out/){ print "FAIL.\n"; }else{ print "WIN." };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.