When you so done with Stackoverflow sorting accepted answers wrong

jay_wick

Jay Wick

Posted on September 3, 2019

When you so done with Stackoverflow sorting accepted answers wrong

Hold my beer, imma write a web extension

I'm aware some already exist, but nothing that respects the super odd anchoring system they have.

Scratch code so far is

[...document.querySelectorAll('#answers > div.answer')].reduce((acc, el) => [...acc, {anchor: el.previousElementSibling, answer: el, votes: +el.querySelector('div[itemprop="upvoteCount"]').getAttribute('data-value')}], []).sort((a, b) => b.votes - a.votes)
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
jay_wick
Jay Wick

Posted on September 3, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related