Skip to content

Instantly share code, notes, and snippets.

@namuan
Last active August 11, 2024 13:39
Show Gist options
  • Save namuan/11176f052e63c215bd6589ebccbce460 to your computer and use it in GitHub Desktop.
Save namuan/11176f052e63c215bd6589ebccbce460 to your computer and use it in GitHub Desktop.
Remove all interests and topics on Twitter

Screenshot 2023-05-21 at 11 34 40@2x

var elements = document.querySelectorAll("[aria-label^='Dismiss']");

elements.forEach(element => {
  element.click();
});

https://twitter.com/settings/your_twitter_data/twitter_interests

async function clickCheckedCheckboxesWithDelay() {
  const checkboxes = document.querySelectorAll('input[type="checkbox"][aria-describedby^="CHECKBOX_"]');
  
  for (const checkbox of checkboxes) {
    if (checkbox.checked) {
      checkbox.click();
      
      console.log(`Clicked checkbox with aria-describedby: ${checkbox.getAttribute('aria-describedby')}`);
      
      await new Promise(resolve => setTimeout(resolve, 2000));
    } else {
      console.log(`Skipped unchecked checkbox with aria-describedby: ${checkbox.getAttribute('aria-describedby')}`);
    }
  }
  
  console.log('Finished processing all checkboxes');
}

clickCheckedCheckboxesWithDelay();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment