-
-
Save ajcrites/72e1a25506a094aff15e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var request = require("request"); | |
var jar = request.jar(); | |
request({ | |
uri: "https://rink.hockeyapp.net/users/sign_in", | |
jar: jar | |
}, function (err, response, body) { | |
var authenticity_token = body.match(/name="authenticity_token".*?value="(.*?)"/)[1]; | |
request({ | |
uri: "https://rink.hockeyapp.net/users/sign_in", | |
form: { | |
"user[email]": "", | |
"user[password]": "", | |
"what": "sign_in", | |
"commit": "Sign In", | |
"authenticity_token": authenticity_token, | |
}, | |
method: "POST", | |
jar: jar, | |
followAllRedirects: true, | |
}, function (err, response, body) { | |
request({ | |
uri: "https://rink.hockeyapp.net/manage/teams/new", | |
jar: jar, | |
}, function (err, response, body) { | |
var authenticity_token = body.match(/name="authenticity_token".*?value="(.*?)"/)[1]; | |
request({ | |
uri: "https://rink.hockeyapp.net/manage/teams", | |
jar: jar, | |
form: { | |
authenticity_token: authenticity_token, | |
"team[name]": "AndrewTest2", | |
}, | |
method: "POST", | |
}, function (err, response, body) { | |
}); | |
}); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment