SoundCloud :: Hide themusictea/Popular Selection Search Results

Hides search results from users/accounts "themusictea" and "Popular Selection"

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         SoundCloud :: Hide themusictea/Popular Selection Search Results
// @namespace    https://greasyfork.org/en/scripts/396187-soundcloud-hide-themusictea-popular-selection-search-results
// @version      1.0
// @description  Hides search results from users/accounts "themusictea" and "Popular Selection"
// @author       newstarshipsmell
// @include      /https://soundcloud\.com/search/(albums|sets)\?q=.+/
// @grant        none
// ==/UserScript==

(function() {
	'use strict';

	var scriptWait = 200;

	function hideResults() {
		if (!bGbl_ChangeEventListenerInstalled)
		{
			bGbl_ChangeEventListenerInstalled = true;
			document.addEventListener("DOMSubtreeModified", HandleDOM_ChangeWithDelay, false);
		}

		var results = document.querySelectorAll('li.searchList__item');
		var resultsUsers = document.querySelectorAll('li.searchList__item span.soundTitle__usernameText');
		for (var i = 0, len = resultsUsers.length; i < len; i++) {
			if (/(themusictea|Popular Selection)/.test(resultsUsers[i].textContent)) {
				results[i].style.display = 'none';
			}
		}
	}

	function HandleDOM_ChangeWithDelay(zEvent) {
		if (typeof zGbl_DOM_ChangeTimer == "number")
		{
			clearTimeout (zGbl_DOM_ChangeTimer);
			zGbl_DOM_ChangeTimer = '';
		}
		zGbl_DOM_ChangeTimer = setTimeout (function() { hideResults(); }, scriptWait);
	}

	var zGbl_DOM_ChangeTimer = '';
	var bGbl_ChangeEventListenerInstalled = false;

	window.addEventListener ("load", hideResults, false);
})();