diff --git a/deletechannel.js b/deletechannel.js new file mode 100644 index 0000000..05d1ee1 --- /dev/null +++ b/deletechannel.js @@ -0,0 +1,32 @@ +let lines = [ +]; + +lines.forEach(line => { + fetch("https://sketchersunited.org/channels/2/posts/" + line.split("/")[4], { + "credentials": "include", + "headers": { + "Accept": "application/json, text/plain, */*", + "X-CSRF-TOKEN": document.querySelector('meta[name="csrf-token"]').content, + "X-XSRF-TOKEN": document.cookie.split("XSRF-TOKEN=")[1], + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-origin" + }, + "referrer": line, + "method": "DELETE", + "mode": "cors" + }) + .then(response => { + if (response.ok) { + return response.json(); + } else { + throw new Error('Network response was not ok.'); + } + }) + .then(data => { + console.log(data); + }) + .catch(error => { + console.error('There was a problem with the fetch operation:', error); + }); +});