Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Created July 20, 2009 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fapestniegd/150369 to your computer and use it in GitHub Desktop.
Save fapestniegd/150369 to your computer and use it in GitHub Desktop.
#!/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