Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
Unfollow Users on Twitter through Javascript on console. Automation to show new users isnt working (everything appears at the same time)
let btns = document.querySelectorAll("[data-testid]")
let unfollowBtns = Array.from(btns).filter(btn => {
    return btn.getAttribute('data-testid').includes('unfollow')
})

for (let i = 1; i <= unfollowBtns.length; i++) {
    setTimeout(() => {
        unfollowBtns[i-1].click()
        setTimeout(() => {
            document.querySelector("[data-testid='confirmationSheetConfirm']").click()
        }, 500);
    }, 1000 * i);
}

Maybe Im not aware how things work in Javascript client side. If I try, at the end of the loop, to include something like:

window.scrollTo(0, document.body.scrollHeight);

and insert everything inside another loop, everything appears to happen at the same time.

Any suggestions? Thanks.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!