add unfollow all script
This commit is contained in:
parent
51699134bc
commit
fbc859dae0
2 changed files with 47 additions and 0 deletions
37
download.js
37
download.js
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue