html5 joinapi

This commit is contained in:
Anton Georgiev 2014-05-12 21:09:40 +00:00
parent c0b60e211b
commit a45ce41d2f
2 changed files with 25 additions and 3 deletions

View File

@ -1,4 +1,4 @@
parser = require 'parser'
xml2js = require 'xml2js'
bbbapi = require './bbbapi'
testapi = require './testapi'
@ -20,7 +20,29 @@ login = (req, resp) ->
bbbapi.create(createParams, serverAndSecret, {}, (error, response, body) ->
#console.log JSON.stringify(response)
bbbapi.join(joinParams, serverAndSecret, {}, (error, response, body) ->
#console.log JSON.stringify(response)
xml = '' + response.body
console.log "\n\nxml=" + xml
{parseString} = require 'xml2js'
parseString xml, (err, result) ->
meeting_id = result.response.meeting_id
user_id = result.response.user_id
auth_token = result.response.auth_token
console.log "\nmeeting_id = " + meeting_id +
"\nuser_id = " + user_id +
"\nauth_token = " + auth_token
joinParams.userID = user_id
joinParams.meeting_id = meeting_id
joinParams.auth_token = auth_token
bbbapi.join(joinParams, serverAndSecret, {}, (error, response, body) ->
if error
console.log "error =" + error
else
console.log "wooo-hoooo"
)
)
)

View File

@ -9,7 +9,7 @@
"express": "4.1.2",
"hapi": "4.1.0",
"js-sha1": "0.1.1",
"parser": "0.1.4",
"xml2js": "0.4.2",
"request": "2.34.0"
}
}