Tag: SMS

A Quick Python App to Send SMS via SMSified’s REST API

Smsified 1Today Voxeo[1] launched SMSified a new service that lets you use a really simple RESTful API to send text messages within the US for only 1 cent per message. I and other colleagues have been writing about SMSified on the SMSified blog and after writing a tutorial about using SMSified with curl, I figured I’d play around with python a bit and code up an example of sending a SMS via python.

So here it is… stored up in my Github account, but also here:

[python]
#!/usr/bin/env python

# Really simple python app for playing with sending SMS messages
# via SMSified – http://www.smsified.com/
# Created by Dan York – May 2011

import json
import urllib

senderid = "dandemo" account
password = "notmyrealpassword" password
sendernum = "5853260800" phone number

apiurl = "https://"+senderid+":"+password+"@api.smsified.com/v1/
smsmessaging/outbound/"+sendernum+"/requests"

address = "14079678424" # Phone num to which you want to send
message = "Hello there" # Whatever msg you want to send

data = urllib.urlencode(((‘address’,address),(‘message’,message)))

f = urllib.urlopen(apiurl,data)

print json.loads(f.read())[‘resourceReference’][‘resourceURL’]
[/python]

As you can see in the code, there are really only three lines of importance: the one building “apiurl”; the one urlencoding the data; and the one opening the URL. The rest are really just for the convenience of using variables.

The final line simply prints out the info included in the result JSON. I was going to (and still may) make that print out prettier or say something more… and if you are reading this sometime in the future, the version on Github may have already morphed and evolved into something different. The point is that now that you get JSON back, you can parse it and start to take action on it.

Anyway, this was just a quick sample app to experiment with SMSified. If you have checked out the new service, it’s free to set up a developer account and currently is free entirely during the beta period.

[1] In full disclosure, Voxeo is my employer.

Use Node.js to Build Your Own SMS or IM Interface to Twitter

NodejslogoWould you like to create your own SMS interface to Twitter? To be able to post your own tweets via SMS? Or would you like to have an IM interface to Twitter using Jabber, GoogleTalk, AIM, MSN, Yahoo, etc?

And would you like to do all this using Node.js?

Sure, Twitter already offers its own SMS interface… but hey, why not build your own to play with Node.js?

That’s exactly what my colleague Justin Dupree did and then wrote up in this great blog post:

Building a Twitter SMS/IM Service with Tropo & Node.js

I love it! I mean… combine 3 of my favorite passions: Twitter, Tropo and Node.js… mix them together, shake them a bit and out pops a very cool mashup that lets you have your own interface to Twitter using SMS or IM.

Kudos to Justin for the great way he walked through the code in the post… and also made the full Tropo-Node-Twitter code available on Github. I’m looking forward to playing with it more and seeing what else I can do with it…

P.S. I’m naturally found on Twitter at twitter.com/danyork.