in reply to send message to sprint PCS through their site

Here's the code I use to post on my watchdog system to report problems to my PCS phone.
use LWP::UserAgent; use HTTP::Request::Common qw(POST); sub message_PCS{ my $msg = $_[0]; $ua = LWP::UserAgent->new(); my $req = POST 'http://www.messaging.sprintpcs.com/sms/check_m +essage_syntax.html', [ mobilenum => '**********', message => $message , call +backnum => '**********', ack_add =>'redalert\@somehwere.com'] $content = $ua->request($req)->as_string; }


Update: Added the modules the sub uses.
UPDATE 04-16-2002 Sprint site has changed. See code update in reply to this message by metlhed_

-Lee

"To be civilized is to deny one's nature."

Replies are listed 'Best First'.
Re: Re: send message to sprint PCS through their site
by metlhed_ (Beadle) on Apr 16, 2002 at 23:56 UTC
    Sprint has changed their site around a bit and that code will no longer work. Here is an updated version:
    #!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTTP::Request::Common qw(POST); &send_message ('1234567890', 'this is the message', 'metlhed'); sub send_message { my ($phone_num, $message, $call_back) = @_; my ($ua, $req, $content); $ua = LWP::UserAgent->new (); $req = POST 'http://www.messaging.sprintpcs.com/smswmgr/BMG/sendme +ssage.jsp', [ device => 'phone', phoneMin => $phone_num, msg => $message, callBackMin => $call_back, copyEsclateRadio => 'NO VALUE', ]; $content = $ua->request ($req)->as_string; }
      Thanks. I ran into that about a month ago when one a server problem arose and I didn't get notified. I neglected to put the updated version here. Now I have it send me a msg every few days to ping me.

      -Lee

      "To be civilized is to deny one's nature."
        hey baby what u doin