Created
July 20, 2009 14:42
-
-
Save fapestniegd/150369 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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