A
Andi Scharfstein
Hi,
I've been expecting a certain eMail for some time now, and I have never
been good with waiting for mail. So, in order to have something to do to
distract me from waiting, I decided to write a script that would forward
the mail to my cellphone using SMS. I am using a German FreeSMS provider
(http://www.myskoda.de) which doesn't expressly forbid automated use of
its services, so it's kind of legal
So, after creating an account there, I tried writing my script, but it
doesn't do what I want it to... I expect this is a result of my lack of
understanding of HTTP messages. I am using http-access2 to access a form
on the FreeSMS site that has the following structure:
<FORM action="/emailsys/sms/sms.html" method="post" name="SendMessage">
<SELECT name=network>
<OPTION selected value="151">+49 151</OPTION>
<OPTION value="160">+49 160</OPTION>
</SELECT>
<INPUT class=ftext maxLength=8 name=number size=20>
<TEXTAREA cols=40 name=msg ></TEXTAREA>
<INPUT TYPE="IMAGE" NAME="send_sms" SRC="../images/opt-hinzu.gif">
</FORM>
After logging in [client.get('http://www.myskoda.de/index.html',
{"callname" => "mylogin", "password" => "mypass"})], which works as
expected, I try to do the following:
client.post('http://www.myskoda.de/emailsys/sms/sms.html', {"network" =>
"151", "number" => "12345678", "msg" => text})
where text is a string that does not exceed 147 chars (that's 160 chars
maximum in a SMS message minus the MySkoda ad). This doesn't work: All I
get is the same site again (which is OK, it's the same URL), but it
should say "Message sent, now 4 messages left [for this month]", which it
doesn't. Yes, I know that's a kind of unusual question. Any ideas?
I've been expecting a certain eMail for some time now, and I have never
been good with waiting for mail. So, in order to have something to do to
distract me from waiting, I decided to write a script that would forward
the mail to my cellphone using SMS. I am using a German FreeSMS provider
(http://www.myskoda.de) which doesn't expressly forbid automated use of
its services, so it's kind of legal
So, after creating an account there, I tried writing my script, but it
doesn't do what I want it to... I expect this is a result of my lack of
understanding of HTTP messages. I am using http-access2 to access a form
on the FreeSMS site that has the following structure:
<FORM action="/emailsys/sms/sms.html" method="post" name="SendMessage">
<SELECT name=network>
<OPTION selected value="151">+49 151</OPTION>
<OPTION value="160">+49 160</OPTION>
</SELECT>
<INPUT class=ftext maxLength=8 name=number size=20>
<TEXTAREA cols=40 name=msg ></TEXTAREA>
<INPUT TYPE="IMAGE" NAME="send_sms" SRC="../images/opt-hinzu.gif">
</FORM>
After logging in [client.get('http://www.myskoda.de/index.html',
{"callname" => "mylogin", "password" => "mypass"})], which works as
expected, I try to do the following:
client.post('http://www.myskoda.de/emailsys/sms/sms.html', {"network" =>
"151", "number" => "12345678", "msg" => text})
where text is a string that does not exceed 147 chars (that's 160 chars
maximum in a SMS message minus the MySkoda ad). This doesn't work: All I
get is the same site again (which is OK, it's the same URL), but it
should say "Message sent, now 4 messages left [for this month]", which it
doesn't. Yes, I know that's a kind of unusual question. Any ideas?