Within my last project about making a PizzaDash, I describe my original inspiration for why I chose pizza. As I was eating that delicious pizza of mine, I was enjoying it with a nice hoppy IPA (my favorite kind of beer).
I then jumped on Google and began searching, I was sure there was something like that out there already. Heck, even the Pizza button idea was somewhat thought of before with the PiePal and there is an entire company that does exactly that: Push For Pizza! So here my next idea was born, find a way to get beer ordered and delivered to me from the push of a button. I quickly thought; Why has no one thought of this!?!
😐💭🍺🔘🚗🏠😍
The Search for Alcohol
The first thing I needed to do was find a way for this to happen. There are several apps out there that provide alcohol delivery across the country — mostly at a local scale — but I researched great services like Liquor Limo,Drizly, Saucey, Thirstie, Minibar, and Klink to name a few. There was only one service that I could find that offered an API (Application Programming Interface), which allows me to send and receive information between their application and mine; that service happened to be Drizly. As I live in the Greater Boulder Area of Colorado, it didn’t leave me too much choice to begin with, but luckily Drizly just happens to deliver there!
More than that, when I reached out to Drizly and told them my idea, they absolutely loved it! So teaming up with Drizly, I was allowed access to their API and after a handful of days/nights of working on it, I sent it off to the engineering team at Drizly to take a look at it. As it was a different experience working with the Drizly team as it was using an unofficial Domino’s API in my last hack on the PizzaDash, it was kind of cool to show the individuals who work on the product each day what an outsider can do with it!
Creating the Apps
The Amazon Dash Hack App
Similarly to my PizzaDash, I am using Amazon AWS IoT Button along with Drizly’s official RESTful API. This IoT button simply connects to your network like an Amazon Dash Button and sends a payload to AWS IoT whenever it is pressed and you can trigger different “rules” based upon the press such as an AWS Lambda function (see code gist below). You can also set a different color pattern for the buttons LED feedback on success/failure as well as intercept a Short, Double, or Longtype of click!
Below you can see the Lambda function I created which you can copy and paste and change the CONFIG and ITEMS variables with your own personal information/order. You will need to request access from Drizly's developer website (I put as a contributor) and then read their documentation about the API to understand how to use it.
To implement the above code you can create a new Rule or edit your existing default one and make sure you select the Action as “Insert this message into a code function and execute it (Lambda).” Then you can create a newResource and skip the blueprint and paste the above modified version of your Lambda function.
You may have noticed my above code has a switch statement that chooses different ITEMS based off of a Single, Double, or Long press. For my own preferences, I set up two great beers for a Single press, and the same two beers but double the quantity for a Double press, and then I have some liquor setup for a Long press because it might be quite a long night. 😏
In Conclusion
If you have the Amazon AWS IoT Button, all you have to do is copy the Gist and change a few things, get it up and running on AWS, and then BAM! You favorite liquor store stop can now be delivered in under an hour at the press of a button! 🍷🍸🍺 Again, If you think about any other ideas or uses for an Amazon Dash Button or the new AWS IoT Buttons, shoot me an email. Cheers and happy hacking! 🍻
Comments