Monday, August 15, 2016

Fun project for talk like a pirate day - a Pirate Slack bot!

(image source - wikipedia.com)

It's almost Internation Talk Like a Pirate day.  If you can believe that such a day exists...

In mid May some friends, Charley, Evan, another new fellow that we met named Josh, and I were at OSCON in Austin.  We participated in a hackathon one day there.

We only had one afternoon to write all of the code.  We utilized an existing npm / node.js package for a head start on the Slack bot.  Here is the Slackbot code - https://github.com/evansong/PirateBotKit .  It allows a user to type in "pirate hello" for example and the bot will output "ahoy".  https://github.com/evansong/PirateBotKit/blob/master/slack_pirate_bot.js has the majority of the Slack bot code.  You can check out the keys and values that we loaded into Redis here - https://github.com/evansong/PirateBotKit/blob/master/dictionary.js .

For the server side, Evan wanted to use Microsoft's WebAPI 2 REST APIs hosted in Azure along with Redis.  Here is the relatively simple REST API endpoints - https://github.com/evansong/PirateApi/blob/master/PirateApi/Controllers/PirateController.cs .

In the end, it was a fun experience to throw an application together in an afternoon.  The creator of Botkit was there and even checked out our app.

If you haven't participated in a hackathon yet I highly recommend it.  It's a great way to work on fun and interesting projects, meet new people, and work with new technologies.  Also, they are great for team building as well if you'd like to organize one for you and your colleagues.

Cheers.

No comments:

Post a Comment