Skip to content
This repository
Vitor Pellegrino December 19, 2012
file 32 lines (28 sloc) 0.607 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
# Description:
# Feeling depressed?
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot cheer me up - A little pick me up
#
# Author:
# carllerche

module.exports = (robot) ->
  robot.respond /cheer me up/i, (msg) ->
    aww msg

  robot.hear /i( am|'m) emo/i, (msg) ->
    msg.send "Let me cheer you up."
    aww msg

aww = (msg) ->
  msg
    .http('http://imgur.com/r/aww.json')
      .get() (err, res, body) ->
        images = JSON.parse(body)
        images = images.data
        image = msg.random images
        msg.send "http://i.imgur.com/#{image.hash}#{image.ext}"
Something went wrong with that request. Please try again.