Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: send message to sprint PCS through their site

by shotgunefx (Parson)
on Aug 20, 2001 at 23:16 UTC ( [id://106323]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://106323]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-24 06:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found