All pastes #634669 Raw Edit

Mine

public text v1 · immutable
#634669 ·published 2007-07-26 16:11 UTC
rendered paste body
#!/usr/bin/perl -w

use Getopt::Long;
use LWP::UserAgent;
use HTTP::Cookies;
use URI;

GetOptions ('t:s' => \$to,
            'm:s' => \$smstxt);

$smstxt = substr($smstxt, 0, 160);

$ua = LWP::UserAgent->new;
$ua->cookie_jar({});


my $firsturl = URI->new( 'http://messaging.sprintpcs.com/textmessaging/compose' );
# makes an object representing the URL

$firsturl->query_form(  # And here the form data pairs:
                        'phoneNumber'    => $to,
                        'message' => $smstxt,
                        );


my $firstresponse = $ua->get($firsturl);


my $secondurl = URI->new( 'http://messaging.sprintpcs.com/textmessaging/composeconfirm' );

$secondurl->query_form(  # And here the form data pairs:
                         'phoneNumber'    => $to,
                         'message' => $smstxt,
                         );


my $secondresponse = $ua->get($secondurl);