Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# Description:
# Hits the Emojini API to find emojis related to an image.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# emojini me <image url>
#
# Author:
# Curalate Dev Team <http://engineering.curalate.com>
#
module.exports = (robot) ->
robot.respond /emojini( me)? (.*)/i, (msg) ->
msg.http('https://emojini.curalate.com/v1/classify?url=' + msg.match[2])
.get() (err, res, body) ->
results = JSON.parse(body)
emojis = ''
(emojis += emoji.emoji.str for emoji in results.results)
msg.send 'Curalate\'s Emojini 3000 grants these emojis: ' + emojis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment