Skip to content

Instantly share code, notes, and snippets.

@kilfu0701
Created March 14, 2017 16:04
Show Gist options
  • Save kilfu0701/48062f58d9a6362e5054aea478b7abd4 to your computer and use it in GitHub Desktop.
Save kilfu0701/48062f58d9a6362e5054aea478b7abd4 to your computer and use it in GitHub Desktop.
var f = function(i) {
$.ajax({
url: 'https://api-native-jizen.kamihimeproject.net/csrf',
dataType: 'json',
type: 'GET',
xhrFields: {
withCredentials: true
}
}).done(function(data) {
$.ajax({
url: 'https://api-native-jizen.kamihimeproject.net/register-email',
dataType: "json",
data: {
email: 'kilfu0701+' + i + '@gmail.com',
},
type: 'POST',
xhrFields: {
withCredentials: true
},
headers: {
'HTTP_X_REQUESTED_WITH': 'xmlhttprequest',
'X-CSRF-TOKEN': data.csrf_token
},
success: function(r) {
console.log('ok', i);
}
});
});
};
var a = 3;
var si = window.setInterval(function() {
if (a >= 500) {
window.clearInterval(si);
}
f(a);
a++;
}, 200);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment