Skip to content

Instantly share code, notes, and snippets.

@EricTendian
Created April 24, 2016 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EricTendian/f399ea55f20b5a549bb992940d8faec4 to your computer and use it in GitHub Desktop.
Save EricTendian/f399ea55f20b5a549bb992940d8faec4 to your computer and use it in GitHub Desktop.
Simple script to remove egg accounts from your Twitter feed.
// Works as of April 23, 2016 on Twitter.com and TweetDeck.twitter.com, in Google Chrome
/*
To use as a bookmarklet, bookmark this URL:
javascript:(function()%7Bvar%20eggs%20%3D%20document.querySelectorAll('.stream-item%20img%5Bsrc%5E%3D%22https%3A%2F%2Fabs.twimg.com%2Fsticky%2Fdefault_profile_images%2F%22%5D')%3Bfor%20(var%20i%20%3D%200%3B%20i%20%3C%20eggs.length%3B%20i%2B%2B)%20%7Bvar%20egg%20%3D%20eggs%5Bi%5D%3Bwhile%20(!egg.classList.contains(%22stream-item%22))%20%7Begg%20%3D%20egg.parentNode%3B%7Degg.remove()%3B%7D%7D)()
*/
var eggs = document.querySelectorAll('.stream-item img[src^="https://abs.twimg.com/sticky/default_profile_images/"]');
for (var i = 0; i < eggs.length; i++) {
var egg = eggs[i];
while (!egg.classList.contains("stream-item")) {
egg = egg.parentNode;
}
egg.remove();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment