The problem

Ever been in a situation where a group of friends cannot decide where to go for lunch? Well, me too.

The solution

Usually all communication in regards to lunch happens on Slack. What if I could create a bot that would suggest us where to go?

To respond to Slack's slash commands I needed a server on the Internet. The fastest way to achieve that was by running it on Heroku.

If you navigate to https://lunchideas.herokuapp.com/ you will be presented with a text string that suggests a Venue. This suggestion is one of 10, pulled from Foursquare's API. Unfortunately, due to lack of time, I did not implement any sort of caching, so each request will also hit Foursquare's API :)

Integrating this with Slack was suprisingly simple, I just added the "Lunch Ideas" app to my Slack workspace and I was immediately able to issue _ /lunch slash command. The joy!

Things I left out

Originally, I set out to not only suggest a Venue, but also provide teasing pictures of yummy food and a link to the menu, but again, due to lack of time I had to leave that one out. I also had to leave out validation that checks if request actually originated from Slack :)

Things I learned

I learned how to consume a JSON API and marshal/unmarshal JSON objects. That was really fun! I also learned how to deploy an app on Heroku in less than 5 minutes!

Built With

  • dockerfile
  • go
Share this project:

Updates

Submission history