This JavaScript code automatically likes all posts on Instagram by clicking the "Like" buttons at 2-second intervals. Once all posts are liked, an alert will notify the user that the task is complete. This script targets Instagram's DOM structure and ensures each like action is performed with a slight delay for a smooth user experience.
var elements = document.querySelectorAll('article section div[role="button"][tabindex="0"] svg title');
var likeButtons = [];
elements.forEach(function(el) {
if (el.innerHTML.toLowerCase().trim() === 'like') {