An Interest In:
Web News this Week
- March 28, 2024
- March 27, 2024
- March 26, 2024
- March 25, 2024
- March 24, 2024
- March 23, 2024
- March 22, 2024
Automate the removal of likes in TikTok
If you have ever tried to delete your likes on TikTok you would have realized that there are too many videos, then it becomes more tedious and time consuming to scroll and delete likes manually.
Remove likes with a JavaScript code
The idea is simple, place the like button and the arrow button to scroll to the next video, then make a loop to intersperse the clicks of the like button and then the scroll button.
Writing the code
For this case we will use an anonymous function that receives two parameters, one is the waiting time to go to the next video and the second is a number that will indicate how many videos the like will be removed, by default this is -1 which is equal to infinity.
The code would look like this:
((timeout, limit = -1) => { const likeButton = document.querySelector('span[data-e2e="browse-like-icon"]').parentElement const scrollButton = document.querySelector('button[data-e2e="arrow-right"]') if (likeButton && scrollButton) { let i = 1, interval = setInterval(() => { likeButton.click() setTimeout(() => scrollButton.click(), 300) if (i++ === limit) clearInterval(interval) }, timeout * 1000) }})(1) // parameters are passed here, which are the timeout and the likes limit, which by default is infinite.
Executing the code
You will need to have a computer or laptop nearby, as it is necessary to use the browser console to run the script.
To remove multiple likes on TikTok quickly and automatically follow the steps below:
- First open tiktok.com and log in.
- Then open your profile page and go to the "Liked" tab.
- Open the developer console with "Ctrl +Shift +J" or by right clicking and selecting "inspect" or by pressing "F12". (Remember to go to the "console" tab).
Copy and paste the code into the console and press enter.
((timeout, limit = -1) => { const likeButton = document.querySelector('span[data-e2e="browse-like-icon"]').parentElement const scrollButton = document.querySelector('button[data-e2e="arrow-right"]') if (likeButton && scrollButton) { let i = 1, interval = setInterval(() => { likeButton.click() setTimeout(() => scrollButton.click(), 300) if (i++ === limit) clearInterval(interval) }, timeout * 1000) }})(1) // -> (timeout in seconds, limit)
Done , now you just have to wait for the likes to be removed without doing anything.
Conclusion
This code works as of today and maybe in a next update of the TikTok web application it will break, but you can leave it in the comments if that happens, I will try to update this article.
Although if you have knowledge you can change and practice how to get the element of both buttons from the html, if you fix that then everything will work perfect.
And remember that the timeout cannot be less than one second.
Original Link: https://dev.to/frankalvarez/automate-the-removal-of-likes-in-tiktok-4oic
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To