Quitter Tools: Hide Queets from Blocked Users

First attempt, many things to improve ?

Quitter Tools: Hide Queets

Download Chrome Extension

UserScript from OpenUserJS

FAQ

¿How to install the Chrome extension?

Download the extension file, go to Configuration in Chrome and select the "Extensions" tab. Drag & drop the downloaded file over the Chrome window.

Changelog

v0.2 (bugfixes)

v0.1 Code (old)

////////////////////////////////////////
// Hide Queets from Blocked Users
// Userscript by @imojito@quitter.no
// https://imojito.com/quitter-tools-hide-queets-from-blocked-users.html
////////////////////////////////////////

// Blocked users as full profile URL
// example var blockedUsers = ["https://quitter.es/aaaa", "http://quitter.no/bbbb"];
var blockedUsers = [""];

function hideQueet() {
blockedUsers.forEach(function(profileurl) {
	//limits and animation, if ( NOT on top )
	if ($(window).scrollTop()){
		$('div#feed-body a.account-group:gt(-20)[href="' + profileurl + '"]').parentsUntil( "#feed-body" ).hide();
	} else {
		$('div#feed-body a.account-group:lt(20)[href="' + profileurl + '"]').parentsUntil( "#feed-body" ).hide(600);
	}
});
}

//** Fire hideQueet **//
// Fire on load
$(window).load(function() {
    hideQueet();
 });

// Fire when loading new queets
//* it seems to fail sooner than later whith
//* $( "#new-queets-bar" ).click(function() {
$('body').on('click','#new-queets-bar',function(){
hideQueet();
});

// Fire when switching stream
$( ".stream-selection" ).click(function() {
	setTimeout(function(){
  	hideQueet();
	}, 1500);
});

// Fire when requesting more queets at bottom
$(window).scroll(function() {
	if($(window).scrollTop() + $(window).height() > $(document).height() - 1000) {
		setTimeout(function(){
  		hideQueet();
	}, 1500); }
});

Hope it helps to avoid annoyances.

Did you enjoy this post and find it valuable?

📡 Subscribe and sign the 📜 Guestbook!

Tip the author! Don't know what Bitcoin is yet?

1Mojitovwnpokdo8uLXvG93pEhBF6MNFoo

Tagged as: ,