Promises, Promises: Oddly Studios Builds A Photobooth with NodeJS, RaspberryPis and Twilio MMS

The team from Oddly Studios flew across Canada with 4 RaspberryPis, 4 big LCD screens, 4 iPads, and one Ubuntu PC in tow. This was all they needed to build and deploy a Twilio MMS powered photobooth. An automobile manufacturer in the Big Three wanted to use the photobooth alongside their feature attraction at Calgary Stampede, a rodeo expo show.

Oddly Studio’s client built out a new take on a beloved carnival game. In their game, you shoot a water gun at a target, and watch a truck skyrocket off the ground on a hydraulic lift. The first one to get the truck to the top of the lift wins. Winners, losers and spectators all want their pictures taken, and that’s where Oddly comes in.

Building A Photobooth With PhantomJS, RaspberryPi, Twilio MMS, NodeJS and A Few Thousand Promises

While players shoot their water guns at the targets, Oddly’s photobooth uses RaspberryPis with camera modules to take time-lapse photos. When the game is done, players select their favourite photo using the iPads and big screens, and have the option of entering their phone number to receive their photo via Twilio MMS. When they choose to send themselves a photo, the photobooth embeds their photo in a western-themed wanted poster, and sends it.

“Even though we’re a small team dealing with large clients”, said Tim Willison, company owner at Oddly, “we feel very comfortable that Twilio gives us the power to offer very innovative MMS-based experiences. We love it.”

Adam Sullovey, a developer at Oddly Studios, said “The fact that photos arrived on our devices a few seconds after tapping ‘Send’ impressed our clients.” During their 9 days at the Calgary Stampede, Oddly sent out nearly 3,000 photos through Twilio MMS.

Integrating Twilio into the photo processing and sending feature of the photobooth took only moments. Twilio’s Javascript client was easy to drop into their NodeJS project, and the API call to send the MMS was wrapped in a promise and added to the end of the photo processing sequence.

Taking A Look At The Code Behind The App
Here’s the node module where Adam wraps the call to the Twilio API in a promise.

In the next code sample, Adam shows off the execute function above in use. In his words “That execute function gets imported into another node module as sendTwilioMessage, and used in a chain of promises that perform other asynchronous tasks related to sending the photo, like post processing & uploading it to AWS S3. The info object gets passed into each task which appends more information to it (for the next task to use), and then resolves or rejects with it depending on whether the task succeeded.”

The photobooth ship was a big one, but nothing Oddly hasn’t seen before. They have a tried and true practice for shipping massive projects on a tight timeline to a degree of excellence. “We laugh in the face of a challenge. Well, laugh, swear, get down to work, and then laugh again when the exhibit is successfully built.”

Learn more about Oddly Studios here