The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::SMS::GenieNL - Send SMS's via free SMS service of www.genie.nl.

SYNOPSIS

 use Net::SMS::GenieNL;
 use Tie::Persistent;

 my %state;

 # Read hash from file (created if not exists).
 tie %state, 'Tie::Persistent', 'GenieNL.pdb', 'rw';

 my $users = [
              {'uid' => 'j.blow','pwd' => 'secret'},
              {'uid' => 'm.jackson','pwd' => 'moonwalk'}
             ];

 my $o = new Net::SMS::GenieNL('USERS' => $users,
                               'STATE' => \%state,
                               'VERBOSE' => 2);
 $o->send_text('+31652477096','test');

 # Save hash back to file.
 untie %state;

DESCRIPTION

This package contains a class sending SMS's via the free SMS service of www.genie.nl. It supports multiple user accounts to help overcome the max 20 SMS's per day limit. It also can maintain a persistent state hash in which the state of the user accounts is saved so that login's aren't always necessary etc.

CLASS METHODS

new ('USERS' => $users, 'STATE' => $state, 'PROXY' => $proxy, 'VERBOSE' => $level);

Returns a new Net::SMS::GenieNL object.

Parameters:

USERS Reference to an array of hash references where each hash reference contains 2 key-value pairs where 'uid' points to the user id and 'pwd' points to the password.

STATE Optional. If specified, then it must be a hash reference. This hash reference will be used to maintain state during the lifetime of the Net::SMS::GenieNL object. It is advisable to used a tied hash so that the hash can be saved to and read from a file. See Tie::Persistent.

PROXY Optional. If specified, then it must be a HTTP proxy URL such as 'http://www.myproxy.com:8080/'. Default is no proxy.

VERBOSE Optional. If specified, it must contain an integer between 0 and 2 where 0 is no verbosity at all, 1 means print only warnings to STDERR, and 2 means print all messages to STDERR. Default value is 1.

OBJECT METHODS

send_text($recipients,$message)

Sends a SMS text message. $recipients must contain one or more recipients specified in international format (ie +31611112222) without spaces and seperated by commas. $message is the text message to send.

HISTORY

Version 0.01 2001-12-12

Initial version. It seems to work fine. Of course if www.genie.nl changes the SMS sending process it might not work no more.

Version 0.02 2002-01-03

Fixed expired cookies bug. Adapted to work with some new redirection changes in web service.

AUTHOR

Craig Manley <cmanley@cpan.org>

COPYRIGHT

Copyright (C) 2001 Craig Manley. All rights reserved. This program is free software; you can redistribute it and/or modify it under under the same terms as Perl itself. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.