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

Mark Jenkins mark at parit.ca
Thu Sep 27 21:54:33 CEST 2007


> 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

done


More information about the Winnipeg mailing list