add unfollow all script

This commit is contained in:
biglyderv 2024-09-30 05:25:43 -04:00
parent 51699134bc
commit fbc859dae0
No known key found for this signature in database
GPG key ID: 33AC87E9ACE66954
2 changed files with 47 additions and 0 deletions

View file

@ -1,37 +0,0 @@
var tree = [], gek, the;
function downloadURI(uri, name) {
var link = document.createElement("a");
link.download = name;
link.href = uri;
link.click();
}
async function downloadUser(user = "08draven") {
let i = 0;
for (let i = 0; ; i++) {
let fetchReq = await fetch(`https://api.scratch.mit.edu/users/${user}/projects/?limit=40&offset=${i * 40}`);
let fetchJson = await fetchReq.json();
if (fetchJson.length < 1) break;
tree = [...tree, ...fetchJson];
}
gek = 0;
}
async function getPoject() {
if (the = tree[gek]) {
the = the.id;
e = await fetch("https://api.scratch.mit.edu/projects/" + the);
e = await e.json();
if (e.project_token != undefined) {
downloadURI("https://projects.scratch.mit.edu/" + the + "?token=" + e.project_token, the)
}
gek++;
} else {
console.log("end");
}
}
await downloadUser();
setInterval(getPoject, 500)