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

NAME

Skytel - SkyTel utilities

    CONCRETE CLASS

SYNOPSIS

    use SkyTel;

    $skytel = SkyTel->new($username, $password);
    $success = $skytel->forward_text( $pin, $date, $autocopy );
    $success = $skytel->forward_voice( $pin, $date, $autocopy );
    $success = $skytel->forward_all( $pin, $date, $autocopy );
    if ( !$success ) { print STDERR $skytel->getError }

DESCRIPTION

Provides utilities to control your skytel account like forwarding text/voice messages.

Requires HTTP::Cookies, LWP::UserAgent, URI and Date::Manip.

AUTHOR

Marc Prewitt <mprewitt@chelsea.net>

SEE ALSO

HTTP::Cookies LWP::UserAgent Date::Manip URI

TODO

Create get forwarding info method.

Disable forwarding before trying to forward it? (doesn't seem like it's needed)

x Create disable forwarding method (version 0.2.0).

x Pin forwarding is not quite working. Keeps saying it's already forwarded (try a different pin). Works fine. Doesn't work if the other pin is already forwarded.

x Create forward_voice methods and forward_all

x Need to handle error codes from HTTP::Response better

x Add autocopy option to forward (autocopy = Enable | Disable)

KNOWN BUGS

Windows Users:

You need to set a TZ variable to your timezone for the date calculations to work correctly. To do this, open the properties of "My Computer" and set a SYSTEM variable TZ to your timezone. I suggest using the form "EST5EDT" so you don't have to change it every 6 months when going to or from daylight savings time.

SSL/HTTPS Notes:

If you receive the message: "501 Protocol scheme 'https' is not supported" you do not have SSL installed and Pager::SkyTel will not be able to communicate with the SkyTel web server. Pager::SkyTel uses LWP::UserAgent for it's https support which in turn uses either IO::Socket::SSL or Crypt::SSLeay. Therefore, if you install one of them, things should work much better. See the README.SSL file which comes with LWP::UserAgent (in the libwww-perl package.)

PUBLIC CONSTANTS

SkyTel::TEXT

Used to indicate the type of forwarding is text.

SkyTel::VOICE

Used to indicate the type of forwarding is voice.

SkyTel::COPY_ENABLE

Used to enable autocopy

SkyTel::COPY_DISABLE

Used to disable autocopy

PUBLIC METHODS

new

    my $skytel = SkyTel->new( $username, $password );

Creates a new SkyTel object.

METHOD TYPE: Constructor

PARAMETERS:

$username - The PIN number of your skytel account. $password - The password for your account

RETURN VALUES: a new SkyTel object or undef if could not login with username/password.

getError

    $errorString = $skytel->getError;

Returns the error message associated with the last error condition for the object.

forward_all

    my $success = $skytel->forward_all( $pin );

Forwards this account's text and messages to the specified account.

METHOD TYPE: Instance

PARAMETERS:

    $pin - Forwarding account pin number
    $date - Date that forwarding expires (max=1 month after today)
    $autocopy - COPY_ENABLE | COPY_DISABLE

RETURN VALUES: 1 if successfully forwarded in, undef if failure.

forward_text

    my $success = $skytel->forward_text( $pin );

Forwards this account's text messages to the specified account.

METHOD TYPE: Instance

PARAMETERS:

    $pin - Forwarding account pin number
    $date - Date that forwarding expires (max=1 month after today)
    $autocopy - COPY_ENABLE | COPY_DISABLE

RETURN VALUES: 1 if successfully forwarded in, undef if failure.

forward_voice

    my $success = $skytel->forward_voice( $pin );

Forwards this account's voice messages to the specified account.

METHOD TYPE: Instance

PARAMETERS:

    $pin - Forwarding account pin number
    $date - Date that forwarding expires (max=1 month after today)
    $autocopy - COPY_ENABLE | COPY_DISABLE

RETURN VALUES: 1 if successfully forwarded in, undef if failure.

disable_forward_all

    my $success = $skytel->disable_forward_all( );

Disables voice and text messaging forwarding.

METHOD TYPE: Instance

PARAMETERS: None

RETURN VALUES: 1 if successfully forwarded in, undef if failure.

disable_forward_voice

    my $success = $skytel->disable_forward_voice( );

Disables voice message forwarding.

METHOD TYPE: Instance

PARAMETERS: None

RETURN VALUES: 1 if successfully disabled, undef if failure.

disable_forward_text

    my $success = $skytel->disable_forward_text( );

Disables text message forwarding.

METHOD TYPE: Instance

PARAMETERS: None

RETURN VALUES: 1 if successfully disabled, undef if failure.

setDebug

    SkyTel::setDebug(1)  #on

    SkyTel::setDebug(0)  #off

Turn on of off debugging.

PROTECTED METHODS

_forward

    $success = $skytel->_forward( $forward_url )

Submits the $forward_url and returns the result. Uses the currently set cookies for login state and updates the cookies with the new server response.

_setError

    $skytel->_setError( $error_message )

Sets an error for this object.

RETURNS: undef

_login

    my $success = $skytel->_login;

Logs into the skytel web server. If error, sets $self->{error} with error message.

METHOD TYPE: Instance

PARAMETERS: None

RETURN VALUES: 1 if successfully logged in, undef if failure.