SSID: CBS-WLAN
user: yapc2008@cbs.dk
pw: Daqy-852

--
Small script to authenticate from command line:

#!/usr/bin/env perl
use strict;
use warnings;
use WWW::Mechanize;

my $URI = 'http://www.google.com/';

my $mech = WWW::Mechanize->new(agent => 'YAPC::EU/2008', autocheck => 1,

quiet => 1);


my $response = $mech->get($URI);

if ($mech->form_name('bluesocket_u')) {

print {*STDERR} "logging in... ";
$mech->field(bs_name => 'yapc2008@cbs.dk');
$mech->field(bs_password => 'Daqy-852');
$mech->submit();

}

die 'not what you expect!'

if $mech->form_name('bluesocket_u');

print {*STDERR} "OK!\n";

______________________________________________________________________

Hacked for Winbox ...

#!/usr/bin/env perl
use stri ct;
use warnings;
our $mech;
BEGIN {

if ( $^O =~ /MSWin/) {
require Win32::IE::Mechanize;
$mech = Win32::IE::Mechanize->new(
agent => 'YAPC::EU/2008', autocheck => 1,  quiet => 1);
} else {
require WWW::Mechanize;
$mech = WWW::Mechanize->new(
agent => 'YAPC::EU/2008', autocheck => 1,  quiet => 1);
}	  

}

my $URI = 'http://www.google.com/';
my $response = $mech->get($URI);

if ($mech->form_name('bluesocket_u')) {

print {*STDERR} "logging in... ";
$mech->field(bs_password => 'Daqy-852');

$mech->submit();
}

die 'not what you expect!'

if $mech->form_name('bluesocket_u');

print {*STDERR} "OK!\n";


Last modified: 14/08/08 15:10 by allan dystrup (‎ady‎)

Home | Edit this page | Tags | Recent changes | History