# Example: tlf.pl 'your message here'
use strict;
use warnings;
use WWW::Mechanize;
use Crypt::SSLeay; # required for login
my $agent = WWW::Mechanize->new(autocheck => 1);
my @strs; # used to save reply message which may be very long
my $verbose=1;
$agent->get('https://www.sendsms.no/mypage/loginPopupForm.c');
# Need to login
$agent->form_name("loginForm");
$agent->field("username", "email\@address.com");
$agent->field("password", "yoursecret");
print "Logging in...\n" if $verbose;
# this will take the default action.
$agent->submit();
$agent->get('https://www.sendsms.no/mypage/sendSmsInline.c');
$agent->field("recipients", "90000000");
$agent->field("text", $ARGV[0]);
$agent->field("Submit", "Send");
$agent->field("sender", "91111111");
$agent->submit();
my $response = $agent -> content(format => "text" );
if ($response =~ m/Ikke/) {print "Kan ikke sende\n";}