Is it possible to filter out Stack Exchange sites from the hot questions list?
-
Aww, the question lost its personality now that I didn't get to mention which SE sites I don't care about :)– SamCommented May 12, 2011 at 8:46
-
1Funnily enough, almost the same question has been asked an hour earlier: Can we customize or filter hot questions and site list in the StackExchange menu? (Or is that one different, @Sam?)– Hendrik VogtCommented May 12, 2011 at 16:26
-
Jeff's answer: meta.stackexchange.com/questions/84389/filtering-hot-questions/…– JYeltonCommented May 12, 2011 at 17:34
-
2I also would like those sites + Christianity, Islam, Bible to not appear in my hot list, while others may not like distracting questions about Gaming or whatever else prevents them from staying focused.– Dan DascalescuCommented Feb 24, 2014 at 0:40
Add a comment
|
1 Answer
Not likely.
But you could using a Greasemonkey script. Not the most complete set of features but it does what you want. Just update the blacklist
and whitelist
within the script to suit your needs.
// ==UserScript==
// @name Filter Hot SE questions
// @namespace http://stackoverflow.com/users/390278
// @include http://stackoverflow.com/*
// @include http://*.stackoverflow.com/*
// @include http://superuser.com/*
// @include http://*.superuser.com/*
// @include http://serverfault.com/*
// @include http://*.serverfault.com/*
// @include http://stackapps.com/*
// @include http://*.stackapps.com/*
// @include http://askubuntu.com/*
// @include http://*.askubuntu.com/*
// @include http://*.stackexchange.com/*
// ==/UserScript==
(function() {
function embedScript(id, main, globalFunctions) {
var scriptElement = document.createElement("script");
scriptElement.type = "text/javascript";
scriptElement.id = id;
var name, content = "";
if (globalFunctions) {
for (name in globalFunctions) {
if (globalFunctions.hasOwnProperty(name)) {
content = content + name + "=(" + globalFunctions[name].toString() + "());\n";
}
}
}
content = content + "(" + main.toString() + "());";
scriptElement.textContent = content;
document.getElementsByTagName("head")[0].appendChild(scriptElement);
return scriptElement;
}
embedScript("filter-hot-se-questions", function () {
var blacklist = [
"english.stackexchange.com",
];
var whitelist = [
"stackoverflow.com",
];
$(".genu").click(function () {
var retryCount = 0;
const retryMax = 3;
function tryFilter() {
var $query = $("#seContainerHot>.itemBox").filter(function () {
var $link = $(this).find(".siteLink");
var site = $link.attr("href").match(/:\/\/(?:www\.)?(.[^\/:]+)/)[1];
return !$.inArray(site, blacklist) && $.inArray(site, whitelist);
});
if ($query.length > 0) {
returyCount = 0;
}
$query.hide();
if (retryCount++ < retryMax) {
window.setTimeout(tryFilter, 1000);
}
}
window.setTimeout(tryFilter, 1000);
});
});
}());
-
1Well, isn't the problem with this that you won't get any other hot questions to replace the ones that your greasemonkey script removes. You could end up with a nearly empty hot questions list if you are only interested in a few SE sites.– SamCommented May 12, 2011 at 8:47
-
@Sam: Naturally. But that's a StackExchange "feature." It's how most things work here anyway. A fixed amount of content is downloaded and uninteresting items are merely hidden away. e.g., hiding questions with uninteresting tags. It would have to make another request to get more content (something on my todo list once I figure out how to do that). Commented May 12, 2011 at 8:52
-
1Well, wouldn't it make more sense to do the filtering server-side?– SamCommented May 12, 2011 at 8:54
-
@Sam: IMHO yes of course. However we can only wish that the SE team does that but they don't. But I don't blame em. With the traffic they have to deal with every day, I can understand why they'd want to offload some of that work. Commented May 12, 2011 at 8:56
-
2there is also the problem that not all users necessarily have control of the pc they are reading from– jk.Commented Sep 3, 2011 at 10:54
-
There is also the problem that users may not use a Greasemonkey-capable browser. Commented Feb 24, 2014 at 0:42