[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debian and MCI paging problem...



david oswald <david.oswald@citicorp.com> writes:

>    I have created a script providing the pin # and the message (which is
> no problem) but HOW do I pass this information back to MCI to get it
> processed if I'm not using a web based browser to fill in the message
> fields. Is this something that I am over looking the obvious - I hope
> so...

Two ideas; both depend on non-interactive ways to call lynx and have
it send form data.  Something like: (sorry about the long line)
  lynx -dump "http://www.mci.com/cgi-bin/sendpage.cgi?pin=234567&textMessage=this%20is%20a%20test%0D%0Asecond%20line.%0D%0A";

Will probably work.  Either that, or this little perl script that
calls lynx (there are probably Perl modules that'll do this for you,
but I couldn't find them).

#!/usr/bin/perl
use URI::Escape;
($pin, $message) = @ARGV;
open(LYNXOUT, 
"|lynx -post_data http://www.mci.com/cgi-bin/sendpage.cgi";);
print LYNXOUT 'pin=', uri_escape($pin), 
              '&textMessage=', uri_escape($message);

The difference between the two is that the long lynx line issues a GET 
request to the host, while the perl script has lynx issuing a POST
request.  The form as MCI has it causes the browser to issue a POST
command, though it shouldn't make any difference to the cgi program.

If you decide that you can use a get request, you may consider using
wget instead of lynx; I think it would be faster for you:
  wget -O - "http://www.mci.com/blahblahblah";

All these commands will produce as output whatever the mci cgi script
spits back to the browser, so you may want to redirect output to
/dev/null.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: