Follow

var inactives = document.getElementsByClassName("inactiv");

for(i=0;i<inactives.length;i++){
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "/ajax/profile/removefriendconfirm.php?uid="+inactives[i].getElementsByClassName("friendButton")[0].dataset['profileid']+"&unref=bd_friends_tab&floc=friends_tab", true);
xmlhttp.send();
}

Why is this undefined? I don't know JS at all.

"Don't worry about the undefined, it just means that the last command you ran had nothing to send back to the console."

Show thread

Updated script, but I was blocked from using as soon as I executed it:

function killFriend(x) {
var inactives = document.getElementsByClassName("inactiv");
if (x < inactives.length) {
inactives[x].getElementsByClassName("friendButton")[0].click();
setTimeout(
function() {
document.getElementsByClassName("FriendListUnfriend")[0].getElementsByTagName("a")[0].click();
setTimeout(function() { killFriend(x+1); }, 2000); }, 2000);
}
};

killFriend(0);

Show thread
Sign in to participate in the conversation
Bitcoin Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!