Skip to content

Instantly share code, notes, and snippets.

@yauri-io
Last active October 23, 2021 20:13
Show Gist options
  • Save yauri-io/1b7815ea945b9e20463d8d0af886dc03 to your computer and use it in GitHub Desktop.
Save yauri-io/1b7815ea945b9e20463d8d0af886dc03 to your computer and use it in GitHub Desktop.

Revisions

  1. yauri-io revised this gist Oct 23, 2021. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions twitter-unfollow.js
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,12 @@
    // open browser console and execute the script
    // use your creativity to extend the script

    var buttons = document.querySelectorAll("[aria-label^='Following']");
    // list all Unfollow button, usually this will contain 6 - 15 buttons
    var buttons = document.querySelectorAll("[aria-label^='Following']");

    for(var i = 0; i < buttons.length; i++) {
    buttons[i].click();
    buttons[i].click(); // click the Unfollow button

    // for clicking Unfollow button in dialog
    document.querySelector('[data-testid="confirmationSheetConfirm"]').click();
    }
  2. yauri-io renamed this gist Oct 23, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. yauri-io created this gist Oct 23, 2021.
    9 changes: 9 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    // open: https://twitter.com/{username}/following
    // open browser console and execute the script
    // use your creativity to extend the script

    var buttons = document.querySelectorAll("[aria-label^='Following']");
    for(var i = 0; i < buttons.length; i++) {
    buttons[i].click();
    document.querySelector('[data-testid="confirmationSheetConfirm"]').click();
    }