User Controls

future ref...

  1. #1
    filtration African Astronaut

    // main
    var edit = function() {
    $('.post').each(function(){
    console.log(this.id)
    var post = getPost(this.id)
    var csrf = getCSRF()
    data = {
    csrfmiddlewaretoken: csrf,
    content: "This post has been edited by a bot I made to preserve my privacy.",
    preview_action: "edit-post",
    post: post
    };

    $.post("https://niggasin.space/post/" + post + "/edit", data)
    })

    setTimeout(function() {
    nextPage()
    }, 5000);
    }

    // Get the token
    var getCSRF = function() {
    return $('input[name=csrfmiddlewaretoken]').val()
    }

    // Get the total pages
    var nextPage = function() {
    var next = $('a.next-page')[0]
    console.log(next)
    if(next) {
    next.click();
    }

    return
    }

    // Get the id of the post
    var getPost = function(post) {
    var id = post.split("-")
    return id[1]
    }

    edit()
    The following users say it would be alright if the author of this post didn't die in a fire!
Jump to Top