[Python Wpg] Can python save the University $17,000?

Peter O'Gorman peter at pogma.com
Thu Sep 27 16:07:56 EDT 2007


Mark Jenkins wrote:
>> The helpful fellow at MTS even sent me a php snippet that uses the
>> protocol:
>>
>> $who = array(‘2045551111’,’2045551112’,’2045551113’);
>> $t = fsockopen(“text.mts.net”, 444);
>> for($i = 0;$i < sizeof($who);$i++){
>> fwrite($t, "PAGE $who[$i]\r\n");
>> $buf = fgets($t);
>> fwrite($t, "MESS $message\r\n");
>> $buf = fgets($t);
>> fwrite($t, "SEND\r\n");
>> $buf = fgets($t);
>> }
>> fwrite($t, "QUIT\r\n");
>>
>> No problem reading that code, right? ;-)
> 
> 
> No problem. Here is the posix shell + netcat version. (Totally offtopic
> on a python list!)
> 
> #!/bin/sh
> MESSAGE="The sky is falling, run."
> for number in 2045551111 2045551112 2045551113; do \
> 
> nc text.mts.net 444 <<EOF
> PAGE $number
> MESS $MESSAGE
> SEND
> EOF

Well, the php version is reading the response codes (though not acting
on any possible error codes), and has the "correct" line endings :-)

Off topic, but it looks like the SNPP protocol is spammer heaven to me.

Peter



More information about the Winnipeg mailing list