Hello!
Many people on the forum said that they wanted to have a function or something to delete a lot of news in their profile.
I’ve mad a javascript script that will delete everything for you !
Just go to : https://www.hackthis.co.uk/user/**your_username**
Open console and run this code :
for(var z=0; z<$('.profile-feed .remove').length; z++) {
var xhttp = new XMLHttpRequest();
xhttp.open( "POST", "https://www.hackthis.co.uk/files/ajax/user.php?action=feed.remove&id="+$($('.profile-feed .remove')[z]).attr('data-fid'), false );
xhttp.send();
xhttp.responseText;
}
How this code works ?
The main loop loops through all the feed. We take the length of the number of feed ( therefore, we’ll delete everything ). You could change it to 10 so it would delete the last 10 new feeds.
We create a XMLHttpRequest because we have to make some request to ‘external’ urls
Now we open a POST request on a url. Let’s talk about this url
"https://www.hackthis.co.uk/files/ajax/user.php?action=feed.remove&id="+$($('.profile-feed .remove')[z]).attr('data-fid')
The first part :
https://www.hackthis.co.uk/files/ajax/user.php?action=feed.remove&id=
That’s just the URL to delete a feed ( when you click on the cross on your profile to delete a feed, you’re making a request to this url )
The second part :
$($('.profile-feed .remove')[z]).attr('data-fid')
I’ve concatenated two things ;
$('.profile-feed .remove')[z]
This code take the zth feed
$( ... ).attr('data-fid')
And this one only take the value of ‘data-fid’ which is the id of the feed
Therefore, this whole jQuery code is just here to take the feed’s id
Then we send the xmlHttp request to the server
And we receive back the last output
Output will probably be something like :
{"status":true}
Annnnnd that’s all ! Thanks for reading and good deletion !