-
-
Save timothyhahn/a444ea92e89da6993d9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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