Teaching a Dumbphone New Tricks
I have a dumbphone. And it’s great, except when I’m lost. Most people open Google Maps on their phone, check out their location on the map, and course correct. I usually drive/hike/bike for another 15 minutes, then call one of my other dumbphone friends and ask them to look things up for me.
I’d been meaning to try AWS Lambda for some time, and this seemed like a good application. AWS Lambda provides serverless computing infrastructure– you upload your code to the AWS servers, it waits for you to trigger it, and you only pay for it when it’s in use. Plus it’s totally scalable, so when this “app” takes over the dumbphone world, it should remain responsive.
In theory it’s pretty simple. The app needs to:
- Get a text message with structured to/from/mode of transportation information
- Pass this to the Google Directions API
- Parse the response
- Return turn-by-turn directions by SMS to the phone
Now the hard part– hooking this process up to SMS and AWS. The few things I’d read about deployment suggested it was possible, but involved lots of bundling virtualenvs, handlers, workers in very specific ways so they could be invoked by AWS.
Luckily I found this awesome tutorial from the SMS service Twilio, which made the process relatively painless. Per their recommendation I wrapped my code using the Claudia Bot Builder package, and it took care of the rest, providing an easy CLI interface to package my code and upload it to Lambda.