Skip to content

Instantly share code, notes, and snippets.

@speeddragon
Created June 10, 2018 16:18
Show Gist options
  • Save speeddragon/c1909cc6f0006f6a44e9cc1c266fd5f3 to your computer and use it in GitHub Desktop.
Save speeddragon/c1909cc6f0006f6a44e9cc1c266fd5f3 to your computer and use it in GitHub Desktop.
POST XML Request to Commie
function send_to_pastebin(captcha) {
var url = "https://commie.io/lib/router.php";
var threadId = "ImQCbHa1";
var post = "do=savecomment&uid=" + threadId + "&comment=" + captcha + "&line=0&user=" + guid;
var request = new XMLHttpRequest();
request.open("POST", url, true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.onreadystatechange = function() {//Call a function when the state changes.
if(request.readyState == XMLHttpRequest.DONE && request.status == 200) {
// Request finished. Do processing here.
console.log("Request sent OK!");
}
}
request.send(post);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment