Skip to content

Instantly share code, notes, and snippets.

@eramdam
Last active December 30, 2016 05:15
Show Gist options
  • Save eramdam/9a8ab345d676f7dcb10946943d14e099 to your computer and use it in GitHub Desktop.
Save eramdam/9a8ab345d676f7dcb10946943d14e099 to your computer and use it in GitHub Desktop.
Scrambled Eggs: hide "eggs" accounts from notifications

Disclaimer

This is just a proof of concept, nowhere complete. I will probably implement this as its own Chrome extension and/or add it to Better TweetDeck.

What's this?

It's a simple userscript that simply hides tweets, likes and retweets from "eggs" accounts on Twitter Web in your Notifications page. That's it. Install it and enjoy.

As said in the disclaimer, it's just a proof of concept. If proven actually useful/efficient it could be turned into a browser extension but will most likely be integrated into Better TweetDeck first.

Twitter ~ GitHub

// ==UserScript==
// @name Scrambled Eggs
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hide tweets from "eggs" accounts on Twitter
// @author Damien Erambert
// @match https://twitter.com/i/notifications
// @grant none
// ==/UserScript==
(function() {
'use strict';
let defaultIncludes = 'default_profile_images';
const removeEggs = () => {
const eggsImages = document.querySelectorAll(`img[src*="${defaultIncludes}"]`);
[...eggsImages].forEach(element => {
const tweet = element.closest('li.js-stream-item');
if (!tweet)
return;
tweet.style.display = 'none';
});
};
// Yes, it's dirty but hey, it works!
setInterval(removeEggs, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment