I just wrote myself a lil script after getting the data I requested from reddit. I deleted all the comments on my user profile (after editing them to gibberish), but there’s still more that doesn’t show up here.

What is the best way to get rid of ALL of it? I don’t want to delete my account before it’s all properly gone, because reddit says they will simply “dissociate” my account from the content, but not actually delete the content. Seeing as I don’t want them benefiting from my 11 years of content, I want to remove it all.

  • Enitoni ( enitoni@beehaw.org ) OP
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 years ago

    I got it. So first of all your need to get your data from reddit. Through that, you can get every id for your posts and comments, and then you write a script that loops through each id and edits then deletes. It’ll take a while depending on how much data you have.

    Here’s the script my friend wrote for me (which works better than the one I wrote):

    const zzz = ms => new Promise(res => setTimeout(res, ms));
    (async () => {
      let uh = document.querySelector("input[name=uh]").value
      for (const id of ids) {
        console.log(id)
        await zzz(3000)
        await fetch("https://www.reddit.com/api/editusertext", {
          method: "post",
          headers: {
            "content-type": "application/x-www-form-urlencoded; charset=utf-8",
          },
          body: new URLSearchParams({
            thing_id: `t1_${id}`,
            text: Math.floor(Math.random() * parseInt("fuckspezfuckspezfuckspezfuckspezfuckspezfuckspezfuckspezfuckspezfuckspez", 36)).toString(36),
            uh,
          }).toString()
        })
        await zzz(1000)
        await fetch("https://www.reddit.com/api/del", {
          method: "post",
          headers: {
            "content-type": "application/x-www-form-urlencoded; charset=utf-8",
          },
          body: new URLSearchParams({
            id: `t1_${id}`,
            uh,
          }).toString()
        })
      }
    })()
    

    You will need to run it with the old reddit layout so that it can fetch the CSRF token.