Python

Moderators: None (Apply to moderate this forum)
Number of threads: 474
Number of posts: 1166

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Sending SMS texts Posted by ITA on 18 Feb 2006 at 5:35 PM
Hi, I'm wondering how to create a program which would be able to send SMS texts to mobile phones very similar to this: http://www.email2sms.ru.

Does anyone know how to do this?

Regards,

ITA
"Let us smite the evil slime eating hordes who may befall us on our quest to be the ultimate programmers of the known universe!"
Report
Re: Sending SMS texts Posted by infidel on 22 Feb 2006 at 8:57 AM
: Hi, I'm wondering how to create a program which would be able to send SMS texts to mobile phones very similar to this: http://www.email2sms.ru.
:
: Does anyone know how to do this?
:
: Regards,
:
: ITA
: "Let us smite the evil slime eating hordes who may befall us on our quest to be the ultimate programmers of the known universe!"

Is there a particular service you are going to use? I know nothing about SMS, but I guess that if there was a webservice that allowed you to send messages, then you could use one of python's builtin modules to send a request to it. Something like an HTTP request or SMTP message is pretty easy to construct and send.


infidel

$ select * from users where clue > 0
no rows returned


Report
Re: Sending SMS texts Posted by ITA on 23 Feb 2006 at 11:29 AM

: Is there a particular service you are going to use? I know nothing about SMS, but I guess that if there was a webservice that allowed you to send messages, then you could use one of python's builtin modules to send a request to it. Something like an HTTP request or SMTP message is pretty easy to construct and send.


I know nothing about SMS either . I came across that website, and suddenly thought it'd be nice if I could write my own script to do it, rather than have to use theirs .

I don't know how they do it for free though... Surely you have to pay for these texts that are sent!? As for the HTTP request, then yes, if say Orange, for example, had an interface/web service to their network, then I agree it would be relatively easy to do.

Regards,

Isaac

"Let us smite the evil slime eating hordes who may befall us on our quest to be the ultimate programmers of the known universe!"

Report
Re: Sending SMS texts Posted by infidel on 24 Feb 2006 at 7:42 AM
This message was edited by Moderator at 2006-2-24 7:42:56

: I know nothing about SMS either . I came across that website, and suddenly thought it'd be nice if I could write my own script to do it, rather than have to use theirs .
:
: I don't know how they do it for free though... Surely you have to pay for these texts that are sent!? As for the HTTP request, then yes, if say Orange, for example, had an interface/web service to their network, then I agree it would be relatively easy to do.

It looks like they offer a limited free service but also a pay service, where I assume you're able to send more or bigger messages.

At any rate, here is an example of submitting form data in Python (from the module documentation of httplib):

>>> import httplib, urllib
>>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
>>> headers = {"Content-type": "application/x-www-form-urlencoded",
... "Accept": "text/plain"}
>>> conn = httplib.HTTPConnection("musi-cal.mojam.com:80")
>>> conn.request("POST", "/cgi-bin/query", params, headers)
>>> response = conn.getresponse()
>>> print response.status, response.reason
200 OK
>>> data = response.read()
>>> conn.close()

You can find the field names and URL, etc on the sms site. I don't know if they'd be happy with you scripting this kind of thing, though, you may want to ask them.


infidel

$ select * from users where clue > 0
no rows returned







 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.