Skip to content

Instantly share code, notes, and snippets.

@Pierce01
Last active July 23, 2021 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pierce01/dd5f26dcc71e5b1e4a57be78bf9416d1 to your computer and use it in GitHub Desktop.
Save Pierce01/dd5f26dcc71e5b1e4a57be78bf9416d1 to your computer and use it in GitHub Desktop.
Unfollow script for Roblox: Need to be used in following: ex https://www.roblox.com/users/10493231/friends#!/following
var sameHeaders = {
"accept": "application/json, text/plain, */*",
"accept-language": "en-US,en;q=0.9",
"sec-ch-ua": "\"Chromium\";v=\"92\", \" Not A;Brand\";v=\"99\", \"Google Chrome\";v=\"92\"",
"sec-ch-ua-mobile": "?0",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site"
}
// your Roblox user ID
var userID = 10493231
var following = (await (await fetch(`https://friends.roblox.com/v1/users/${userID}/followings?sortOrder=Desc&limit=100`, {
"headers": {
...sameHeaders
},
"referrer": "https://www.roblox.com/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "include"
})).json()).data
for (let entry of test) {
await fetch(`https://friends.roblox.com/v1/users/${entry.id}/unfollow`, {
"headers": {
...sameHeaders,
"x-csrf-token": document.querySelector("#rbx-body > meta")["dataset"].token
},
"referrer": "https://www.roblox.com/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": JSON.stringify({
"targetUserId": entry.id
}),
"method": "POST",
"mode": "cors",
"credentials": "include"
})
await shittyAwait()
}
function shittyAwait() {
return new Promise(resolve => {
setTimeout(function() {
resolve()
}, 1000);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment