This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

build Y U NO images

  • Loading branch information...
1 parent b99f9b2 commit 6dc6586f3385f8318bfebb630067429c4b5f767c @alexdean alexdean committed Apr 9, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 src/scripts/yuno.coffee
View
@@ -0,0 +1,20 @@
+# <name> y u no <action> - U NO WHAT IT DOES.
+# Get image generation script at https://github.com/alexdean/yuno
+
+module.exports = (robot) ->
+ robot.hear /(.*) y u no (.*)/i, (msg) ->
+ if not process.env.HUBOT_YUNO_URL?
+ msg.send "HUBOT_YUNO_URL is not set."
+ return
+
+ msg.http(process.env.HUBOT_YUNO_URL)
+ .query(
+ auth: process.env.HUBOT_YUNO_AUTH_TOKEN,
+ name: msg.match[1],
+ action: msg.match[2]
+ )
+ .get() (err, res, body) ->
+ if err
+ msg.send "error: #{err}"
+ return
+ msg.send body

0 comments on commit 6dc6586

Please sign in to comment.