Armin Fuerst

NAME

yesssSMS - Send text messages to mobile phones through the website of yesss!

SYNOPSIS

 use yesssSMS;
 use strict;
 
 # create SMS object
 my $sms=yesssSMS->new();
 
 # login to the site with your phone number and the password
 $sms->login("06811234567","MyPassword");
 
 # check whether login was successful
 if ($sms->getLastResult!=0)
 {
        print STDERR "Error during login: ".$sms->getLastError()."\n";
 }

 # if multiple phonenumbers are available, switch if needed
 $sms->selectPhonenumber('4368187654321');

 # check whether the switch was successfull
 if ($sms->getLastResult!=0)
 {
        print STDERR "Error during selectPhonenumber: ".
                $sms->getLastError()."\n";
 }
 
 # print remaining units of the main subscription
 print "Remaining: ";
 print $sms->{SUBSCRIPTIONS}->[0]->{'items'}->[0]->{'remaining'}." ";
 print $sms->{SUBSCRIPTIONS}->[0]->{'items'}->[0]->{'unit'}."\n";

 # send a text message
 $sms->sendmessage('00436817654321','Just testing...');
 
 # check whether the message was delivered
 if ($sms->getLastResult!=0)
 {
        print STDERR "Error during sendmessage: ".
                $sms->getLastError()."\n";
 }
 
 # logout of site
 $sms->logout();
 
 # check whether login was successful
 if ($sms->getLastResult!=0)
 {
        print STDERR "Error during logout: ".$sms->getLastError()."\n";
 }

DESCRIPTION

Objects of the yesssSMS class are only able to send text messages to mobile phones through the website of yesss!. To be able to use this service, you need to have an account at yesss! (a mobile phone). The target phone number must be provided with the international code starting with 00 (e.g. 0043 for Austria). The text messages are limited to 160 characters.

This module requires following modules:

 * strict
 * warnings
 * HTML::Parser
 * LWP::UserAgent
 * HTTML::Cookies

METHODS

The following method is used to construct a new yesssSMS object:

$sms = yesssSMS->new()

The following method logs into the website with your phone number and the password:

$sms->login(MyPhonenumber,Password)

The following method selects the sending phonenumer (for accounts with multiple phones):

$sms->selectPhonenumer(MyAlternatePhonenumer)

The following method sends a text message if a login was successful before:

$sms->sendmessage(OtherPhonenumer,Textmessage)

It is possible to send multiple text messages during one login.

The following method logs out of the website of yesss!

$sms->logout()

The following method returns the hash to all subscription details:

$sms->getSubscriptions()

Returns an array with the subscription details: * each array contains a hash with "type", "name" and "items". * "type" is either "Tarif" or "Paket" * "name" is the name of the subscription * "items" contains an array with all items contained in the subscription. * each item-array contains a hash with "unit", "used" and "remaining" * "used" is the amount of already used units during the current accounting period * "remaining" is the amount of already remaining units during the current accounting period * "unit" contains the unit of "used" and "remaining"

The following method returns the current login state:

$sms->getLoginstate()

0 means: not logged in

1 means: logged in

The following method returns the result of the last operation:

$sms->getLastResult()

0 means: successful

>0 means: an error occured

The following method returns a textual description of the result of the last operation:

$sms->getLastError()

The following method returns the LWP::UserAgent last return content:

$sms->getContent()

HISTORY

1.00

Original version

2.00

Adopted for the new website being online since August 1st, 2014

2.10

Added the possibility to change the sending phonenumber Login and selecting phonenumber reads details about tarifs and packages Details about tarif and packages are available through getSubscriptions

2.11

Added "Changes"

2.12

Corrected typo in description

2.13

Improved documentation for getSubscriptions().

AUTHOR

Armin Fuerst

COPYRIGHT AND LICENSE

Copyright (C) 2014 by Armin Fuerst

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.