I'm trying to build my reputation on this site, and I've been frequenting the bounties tab. Is there a built-in way to sort by "highest bounty first", and if not, is there a way I can add this to my own browser to sort from my machine using JavaScript and the Chrome Console or an alternative tool?
1 Answer
There are lots of great ways to grow your reputation points on here. Check out the responses to this thread for some great ideas on how to grow your presence here. I've been on this site for years but only recently started focusing on my growth as well, and well, it comes slowly at times and sometimes you'll get downvoted for seemingly no reason, but you'll learn along the way how better to phrase your questions and answers and be a productive part of this community.
I don't think there is any native way to do this, but I have a few browser-level functions I use, which I store in the Tampermonkey extension. You can also use Greasemonkey if you also program in Firefox. Just create add a global function there which does what you need it to do. This function should do the trick if you're trying to run this function from your console on those bounty listing pages manually:
// add this function in TamperMonkey/GreaseMonkey
const sortByBounty = () => {
const questions = document.querySelector('#questions');
Array.from(document.querySelectorAll('#questions > div'))
.sort((a,b) =>
parseInt(b.querySelector('.bounty-indicator').textContent) -
parseInt(a.querySelector('.bounty-indicator').textContent))
.forEach(q => questions.appendChild(q));
}
// to run the function
sortByBounty();
-
1
-
@charlietfl Nice! I had no idea. I only use TamperMonkey myself and only really code in Chrome Apr 29, 2021 at 1:26
-
1Why are you wrapping that code in a function, only to immediately execute said function? Just run the code itself :D– CerbrusApr 29, 2021 at 7:12
-
@Cerbrus this function is saved in TamperMonkey without its executing statement. In my post, I explained that the executing function was to be manually run in the console and that the function would be saved in TamperMonkey. It is not immediately invoked. Apr 29, 2021 at 14:11
-
1
-
-