For those of you who don't want to follow a link, DOTGO is a FREE way to SMS-enable your website. It funnels SMS messages to your public domain name (No IP Addresses), where an XML file listens to keywords in the message to decide how to respond to the sender.
The XML listener file (.cmrl) is simple, but can do many complicated things, including:
- Forwarding on requests to web services, to do some data crunching, perhaps
- store session variables
- respond with RSS feeds
- auto-correct fat-fingered input
Interacting using Keywords
Based on the DOTGO examples, the SMS messages sent to a server usually follow a formula:
<your domain name> <command> <keywords>
For example, I might send the text to 368266 (DOTCOM): "ryanmwhitley getupdates ESRI", which might return the latest articles I wrote with the tag ESRI.
What happens here is that this message gets sent to 368266, which looks at the 1st word (ryanmwhitley), and routes the remainder of the message to ryanmwhitley.com/index.cmrl. It knows to go to .com because of the specific number. DOTGO has other numbers for .org etc.
Anyway, the remainder of the message (getupdates ESRI) is parsed by the .cmrl file sitting in the root of my website. It sees the 'getupdates' command, so forwards the rest on to a web service, which is passed the string 'ESRI'. It looks up posts with the tag ESRI (just regular web service stuff in C#), and returns the list to the Phone of the original user.
This is great when you only have a few commands and keywords. But the problem is how to get your users to remember all of the different keywords and combinations (you have to get it in the right order).
Is there an easier way?
I wanted something easier for my users (of course, harder for us to implement), so came up with a scheme to have a little back and forth.
First, I wanted the user to be able to select from a menu of options, and not have to remember all of my different keywords.
So I set up my .cmrl file to just listen for anyone who sends a text to 368266 with just ryanmwhitley as the message.
My XML snippet is: <match pattern="">>, meaning no matter what people send, I'm just going to spit back some results. Inside of that
<message>
<content>
Welcome to ryanmwhitley SMS.
Please enter your location (town name, district name or X,Y)
</content>
So, sending a txt to 368266 with the domain name would return the welcome message above to the phone, with a prompt for the user to respond with their location.
I have to go change diapers, so more on DOTGO later.