TGViewer
JavaHere's Blogs 🚀 JavaHere's Blogs 🚀 @javahereblogs · 2.23K subscribers
Post #640 374
// Select all buttons with a child span element with text content equal to "Following"
var buttons = document.querySelectorAll("button span");

// Loop through the buttons and simulate a click event on each one
buttons.forEach(function(span) {
if(span.textContent.trim() === "Following") {
var button = span.closest("button");
button.click();

// Wait for the dialog to appear
setTimeout(function() {
// Select the button with a child span element with text content containing "Unfollow"
var unfollowButton = document.querySelector("dialog button span");
if(unfollowButton && unfollowButton.textContent.trim().includes("Unfollow")) {
var unfollowButtonParent = unfollowButton.closest("button");
unfollowButtonParent.click();

// Wait for the "Unfollow" request to complete and then close the dialog
setTimeout(function() {
var closeButton = document.querySelector("dialog [data-testid='close-modal']");
closeButton.click();

// Wait for the dialog to close
setTimeout(function() {
console.log("Dialog closed.");
}, 1000);
}, 3000);
} else {
console.log("Unfollow button not found or has incorrect text content.");
}
}, 1000);
}
});
More from @javahereblogs
  1. Oct 3, 20268-oktyabr(Kelayotgan payshanba)dan boshlanadigan bo'ldi! Dars vaqtlari: Payshanba - 22:00…
  2. Sep 29, 2026Universitet boshlandi Qiziq narsalar örgatishyabdi. Töğri, internetda tekinga örgansa böla…
  3. Sep 26, 2026Avtomatlashtirish Oldin: 1. Kurs e'loni 2. Google form orqali ro'yxatdan o'tish 3. Har bir…
  4. Sep 22, 2026Muammo faqat pulda emas… 1. Bo’lib to’lash qo’shilganda odatda narxlari to’liq to’lagandan…
  5. Sep 19, 2026DSA-4 Endi kuchliroq. Tizimli. 3 oy. Yangiliklar: • Platforma (planlar katta) • Kurs uchun…
  6. Aug 28, 2026Yechim 1. aID lardan foydalanib BF (Bloom Filter) qurdim. 2. B table ni BF o'tkazib oldim.…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →