Choosing My First Drink With SendGrid, Foursquare, Node.js and Socket.io
I turned 21 on Saturday at PayPal Battle Hack NYC. Not being from the city, I wanted to find out where to go to get my first drink. I knew I had a chance to get up and speak at the beginning of the event, so I decided to create an app to help me figure out where I should go Saturday evening. I’m sharing it here in case you ever find yourself in a strange city (21st birthday or not) and want to find out where to go eat or get a drink.
I integrated with Foursquare to find the five bars closest to the event. Not knowing precisely where I was going to be, I also pulled my last Foursquare checkin to figure out where I was.
To gather votes, I used SendGrid’s Parse Webhook. This webhook has SendGrid’s servers process emails your app recieves and then POST them to your server. I asked Battle Hack participants to email me with the venue’s letter (A-E) in the subject.
To setup where the webhook should POST data to, go to the Parse Webhook section of the SendGrid control panel. Enter your app’s information (namely to POST data to YOURDOMAIN.TLD/email), point your MX record to mx.sendgrid.net and you’re good to go! (Keep in mind DNS can take up to fourty-eight hours to propagate.)
Finally, the frontend needs to tally votes, to do this it needs to recieve information from Socket.io. This data is then processed and tallied.
Tying It All Together
Once everything is connected, there’s one part that’s missing: the frontend look and feel. That’s not included in this article, but you can see the full working app on Github.
In the end, the nice folks at Battle Hack sent me to Top of the Strand, which was far too classy for my startup-tee-clad 21st birthday. Photo by Maura Teague
Sign up to get our latest blog posts in your inbox.