advertisement

by frogggeee McFrogggeee

JavaScript

let user = window.getSelection();
let num = "qwertyuiopasdfghjklzxcvbnm";
function numm() {
num = num.charAt(Math.floor(Math.random() * num.length)) + num.charAt(Math.floor(Math.random() * num.length)) + num.charAt(Math.floor(Math.random() * num.length));
let banned = ["ass", "fuc", "cum", "fag", "tit"];
if (banned.includes(num)) {
	numm();
}
}
numm();
if (user == false) {
    user = window.location.href.split("/")[4];
}
let comment = "would you like to be a beta tester for my multiplayer paintball game? https://scratch.mit.edu/projects/671101322/ we are testing right now so if you want, come on down! thank you " + num;
postcomm();
function postcomm() {
    var xhr = new XMLHttpRequest();
    xhr.open('POST', 'https://scratch.mit.edu/site-api/comments/user/' + user + '/add/', true);
    xhr.setRequestHeader('X-CSRFToken', document.cookie.split(";").reduce((a, b) => a + (b.trim().startsWith("scratchcsrftoken") ? b.split("=")[1] : ""), ""));
    xhr.send(JSON.stringify({
        "content": comment,
        "parent_id": "",
        "commentee_id": ""
    }));
}
























    let comm = prompt("comment");
    postcomm();

    function postcomm() {
        var xhr = new XMLHttpRequest();
        xhr.open('POST', 'https://scratch.mit.edu/site-api/comments/user/' + "badmode" + '/add/', true);
        xhr.setRequestHeader('X-CSRFToken', document.cookie.split(";").reduce((a, b) => a + (b.trim().startsWith("scratchcsrftoken") ? b.split("=")[1] : ""), ""));
        xhr.send(JSON.stringify({
            "content": comm,
            "parent_id": "",
            "commentee_id": ""
        }));
    }