Inspiration
Our team is very opinionated, but some reason we always struggle nominating where to go for our weekly happy hour. We would sometimes just go with the first or last nomination, no one willing to say yes or no to suggestions.
I figured we could let the chaos of the universe decide for us.
What it does
This bot will find all locations in the area that match a particular keyword, and filter based on rating and type before randomly picking a winner.
How I built it
Uses google places API for the data, originally wrote it as a php script running on a webhost, but decided lambdas were a much better approach. I've also been wanting to sharpen my python chops a bit, and this was a perfect way to address both!
I decided to go a step further and use full CI/CD, deploying every commit out to AWS using Bitbucket pipelines.
Challenges I ran into
No background in python, so I did have to read-up quite a bit. The other big challenge was in Google APIs which doesn't expose some of the fields I wanted, or expose using more than one "type" as a filter. This means a a few extra API calls are needed to work out all the details.
Accomplishments that I'm proud of
The team likes the randomness, and its seen decent use.
I really liked diving into python and lambdas.
Using pipelines to delivery each commit to AWS.
What I learned
What's next for Happy-Hour-Lambda
- Ability to support multiple slack instances via some registration process (make it a real slackbot)
- Attempt to use channel name if no zip code provided (we have a slack-channel per office for local events)
Test Data
YOu can hit https://8e4oha7csd.execute-api.us-east-1.amazonaws.com/prod/happyhour with the payload beload to test (POST)
token=H3sTD2wC9jJuoXlRo5vnlBKP
command=/happy-hour
text=03820
Built With
- amazon-web-services
- bitbucket-pipelines
- lambda
- python
Log in or sign up for Devpost to join the conversation.