The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::Nonoh - make nonoh calls from Perl

VERSION

version 0.1

SYNOPSIS

    my $no = WebService::Nonoh->new(
        service => 'nonoh.net',
        user    => $username,
        pass    => $password,
        printer => sub { print +shift, ': ', @_, "\n" }
    );
    $no->login;
    $no->bala;
    $no->call('+1234567', '+7654321');
    $no->login;
    $no->sms($username, '+7654321', "Hello Mr.");
    $no->logout;

DESCRIPTION

You can use Nonoh or a compatible web service, many of betamax might work. This module allows you to send SMS or connect calls from Perl. Please also see nonoh for the docs of command line app.

Warning: The websites do have a captcha if you're unlucky. Then this script also won't work...

METHODS

new

create new webservice object. the following settings must be specified:

service

website address of service to use, e.g. nonoh.net

user

username for log in

pass

password for your account

printer

connect a function here that is called to print any status messages or progress information. default is to use Perl's print function

run

command line helper function, please see nonoh

login

issue log-in request to website

sms

send SMS, following parameters are expected:

$from

a "from" address (must be registered in the web interface first)

$to

phone number to send SMS message to

$message

the message content

call

establish a call between two phone numbers, following parameters are expected:

$from

the number that should be called first, in international format

$to

the number that should be called after the first one has been picked up.

bala

this method enquires your balance and "free days" (free minutes to selected destinations received after charging the account). if the parameter $to_printer is true, it will send output directly to the printer, otherwise a pair of ($balance_string, $freedays_string) is returned.

if log-in failed, two empty strings are returned.

logout

issue log-out request to the website

AUTHOR

Ailin Nemui <ailin at devio dot us>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Ailin Nemui.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.