Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Created August 3, 2015 19:25
Show Gist options
  • Save ajcrites/72e1a25506a094aff15e to your computer and use it in GitHub Desktop.
Save ajcrites/72e1a25506a094aff15e to your computer and use it in GitHub Desktop.
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