let api = 'https://graph.facebook.com/v14.0'; | |
let headers = { | |
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", | |
"accept-language": "en-US,en;q=0.9", | |
"cache-control": "max-age=0", | |
"sec-ch-ua": "\"Google Chrome\";v=\"107\", \"Chromium\";v=\"107\", \"Not=A?Brand\";v=\"24\"", | |
"sec-ch-ua-mobile": "?0", | |
"sec-ch-ua-platform": "\"Windows\"", | |
"sec-fetch-dest": "document", | |
"sec-fetch-mode": "navigate", | |
"sec-fetch-site": "none", | |
"sec-fetch-user": "?1", | |
"upgrade-insecure-requests": "1" | |
}; | |
let f = await fetch(`${api}/me/accounts?access_token=${__accessToken}`, { | |
"headers": headers, | |
"referrerPolicy": "strict-origin-when-cross-origin", | |
"body": null, | |
"method": "GET", | |
"mode": "cors", | |
"credentials": "include" | |
}); | |
let js = await f.json(); | |
let data = js['data']; | |
let msg = ''; | |
for (let i = 0; i < data.length; i ++) { | |
msg += `${i+1}. ${data[i]['name']}\n`; | |
} | |
let fpIndex = prompt(`Choose your FanPage (for example, 1):\n${msg}`); | |
let fp = data[fpIndex-1]; | |
let fpId = fp['id']; | |
let usersText=prompt(`${fp['name']} selected!\nEnter user ids to block (divided by Enter):`); | |
let users = usersText.split('\n'); | |
var userIds=[]; | |
let r = /\d+/; | |
for (var i=0;i<users.length;i++){ | |
userIds.push(r.exec(users[i])[0]); | |
} | |
console.log(`Total users found:${users.length}`); | |
let result = await blockUsers(fpId,fp['access_token'],userIds); | |
alert(JSON.stringify(result)); | |
async function blockUsers(fpId,fpToken,users){ | |
let f = await fetch(`${api}/${fpId}/blocked?access_token=${fpToken}&method=post&user=${JSON.stringify(users)}`, { | |
"headers": headers, | |
"referrerPolicy": "strict-origin-when-cross-origin", | |
"body": null, | |
"method": "GET", | |
"mode": "cors", | |
"credentials": "include" | |
}); | |
let js = await f.json(); | |
console.log(js); | |
return js; | |
} |
Sad it doesn't work anymore with new FanPage type
Updated the script, now it does work with New Page Experience.
Sad it doesn't work anymore with new FanPage type
Updated the script, now it does work with New Page Experience.
Wow awesome I tested it it really works! You made my life easier bro
Wow awesome I tested it it really works! You made my life easier bro
You are welcome, man!
Hello bro I struggled in step when I need to export new blocked users from FP new type. How can I do that?
Hello bro I struggled in step when I need to export new blocked users from FP new type. How can I do that?
Yep, no problem. I made this script to export blocked users: https://gist.github.com/dvygolov/eaf57fd387df03cce9c04544fa28f220
Also I updated the article about these scripts: https://yellowweb.top/zaranee-ubiraem-negativno-nastroennuyu-auditoriyu-s-pomoshhyu-skriptov-importa-eksporta-nadoedlivyh-kommentatorov/
You are welcome.
Hello bro I struggled in step when I need to export new blocked users from FP new type. How can I do that?
Yep, no problem. I made this script to export blocked users: https://gist.github.com/dvygolov/eaf57fd387df03cce9c04544fa28f220 Also I updated the article about these scripts: https://yellowweb.top/zaranee-ubiraem-negativno-nastroennuyu-auditoriyu-s-pomoshhyu-skriptov-importa-eksporta-nadoedlivyh-kommentatorov/
You are welcome.
Awesome! Thank you so much
Sad it doesn't work anymore with new FanPage type