Skip to content
Browse files

Merge pull request #324 from webandtech/master

Join.me screen sharing
  • Loading branch information...
2 parents bf42097 + 56f5a7f commit 5d3770a6d92838330345c0d3ef12485a4b1b2bd6 @atmos atmos committed
Showing with 34 additions and 0 deletions.
  1. +34 −0 src/scripts/joinme-generator.coffee
View
34 src/scripts/joinme-generator.coffee
@@ -0,0 +1,34 @@
+# Integrates with join.me
+#
+# joinme - Generates a new join.me 9-digit code and outputs a presenter link (download)
+# and a participant link (to view the session)
+#
+
+module.exports = (robot) ->
+ robot.respond /joinme$/i, (msg) ->
+ joinme(msg)
+
+joinme = (msg) ->
+ authCode = process.env.HUBOT_JOINME_AUTHCODE
+
+ unless authCode?
+ msg.send "Join.me account isn't setup. Use https://secure.join.me/API/requestAuthCode.aspx?email=EMAIL&password=PASSWORD to get your authCode."
+ msg.send "Then ensure the HUBOT_JOINME_AUTHCODE environment variable is set"
+ return
+
+ msg.http('https://secure.join.me/API/requestCode.aspx')
+ .query
+ authcode: authCode,
+ .get() (err, res, body) ->
+
+
+ if body.indexOf "OK" isnt "-1"
+ split = body.split(":")
+ ticket = split[2].replace(/^\s+|\s+$/g,"").replace("#chr(13)#|#chr(9)#|\n|\r", "")
+ code = split[1].split("TICKET")[0].replace(/^\s+|\s+$/g,"").replace("#chr(13)#|#chr(9)#|\n|\r", "")
+ presenter = "Presenter: https://secure.join.me/download.aspx?code="+code+"&ticket="+ticket
+ viewer = "Viewer: http://join.me/"+code
+ msg.send presenter
+ msg.send viewer
+ else
+ msg.send "ERROR join.me #epicfail!"

0 comments on commit 5d3770a

Please sign in to comment.
Something went wrong with that request. Please try again.