Delete everything from your feed ( profile page )

Mugi [Mugiwara27]
8 years ago

0

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 !

0replies
1voice
163views
You must be logged in to reply to this discussion. Login
1 of 1

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss