This repository has been archived by the owner on Jun 8, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from webandtech/master
Join.me screen sharing
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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!" |