Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #324 from webandtech/master
Browse files Browse the repository at this point in the history
Join.me screen sharing
  • Loading branch information
atmos committed Mar 1, 2012
2 parents bf42097 + 56f5a7f commit 5d3770a
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions 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.