jjgrainger

Kitten Therapy

Recently it was National Stress Awareness Day and Twitter was full of videos, articles and tips on how to combat stress.

People manage stress in a variety of ways. Some meditate to level themselves by watching their breath. Others exercise to work out the stress they’re feeling. And a simple walk in the park can make you feel calm.

What about fluffy kittens? Cute, tiny, fluffy kittens!

kitten

If kittens are your thing, and you use Hubot as your chatbot, I’ve created a script that delivers gifs of cute kittens on demand.

# Description:
# Feeling down? Boost your mood with some Kitten Therapy!
#
# Dependencies:
# None
#
# Configuration:
# GIPHY_API_KEY - Your Giphy API key
#
# Commands:
# hubot kittens - Returns a random gif of cute kittens
module.exports = (robot) ->
# Giphy API url with key and tag
# this example uses the Giphy Public Beta API Key, its recommended
# you request a production key when needed https://github.com/Giphy/GiphyAPI#access-and-api-keys
giphy_api_key = process.env.GIPHY_API_KEY || 'dc6zaTOxFJmzC'
giphy = 'http://api.giphy.com/v1/gifs/random?tag=kittens&api_key=' + giphy_api_key
# respond to 'hubot kittens'
robot.respond /kittens/i, (msg) ->
robot.http(giphy).get() (err, res, body) ->
data = JSON.parse body
url = data.data.image_url
msg.send url
view raw kittens.coffee hosted with ❤ by GitHub

Once installed, simply type hubot kittens to receive a dose of kitten therapy. You will feel the stress escape you as you watch gifs of adorable kittens.

Enjoy!