23

There are a few members of Stack Overflow especially who have a ridiculous number of helpful flags.

At the moment, there does not appear to be any way to display the top users with the most helpful flags. Even though this information is already available publicly, there does not seem to be any way to query all users and make a custom leaderboard, using SEDE, or other programming tools.

A quick search on main META did not yield anything related to this topic.

This is not limited to Stack Overflow (although that site will no doubt prove to be the most voluminous).

Is there any way to see a short list of top flaggers on the Stack Exchange sites?


See this? This is what I'm talking about! Totally awesome.

enter image description here

15

One way to find out is to look at the profile of every user with the Marshal badge, and compare. On Stack Overflow, the following users have 20K+ helpful flags as of now (2019-08-27):

  1. Andy, 130603 helpful flags
  2. Floern, 125891 helpful flags
  3. Pang, 99641 helpful flags
  4. Jamal, 47735 helpful flags
  5. gnat, 41872 helpful flags
  6. Wai Ha Lee, 37314 helpful flags
  7. Tunaki, 37170 helpful flags
  8. ayaio, 36201 helpful flags
  9. CRABOLO, 34947 helpful flags
  10. Shree, 34704 helpful flags
  11. Bo Persson, 22717 helpful flags
  12. Taryn, 22118 helpful flags
  13. Mitch Wheat, 20945 helpful flags
  14. Zoe, 20780 helpful flags

A complete list can be found here on GitHub; note that some users have less than 500 helpful flags because of a bug in the system, cf. I got the Marshal badge with less than 500 helpful flags.

Notes:

  • Andy is now a moderator and spends more time handling flags than casting them. Before that, he ran a bot under his account to automatically flag comments.
  • Community is a bot raising flags based on heuristics.
  • CRABOLO and Tunaki are no longer active.
  • Taryn is now a moderator community manager DBA at Stack Overflow.
  • Not all helpful flags are equally helpful.
  • 2
    Moderators still have their helpful flag counts incremented, it's just rare for moderators to actually cast flags (usually only ever cast spam/abusive flags to insta kill a post) so the number rarely goes up anymore. Moderators are simply ineligible to receive the helpful flags badges (like Marshall) while they have a diamond. – animuson Apr 5 '18 at 1:50
  • You forgot a list item: "SFTP is me". ;) (will become relevant soon when you'll change name...) – Shadow The Burning Wizard Apr 5 '18 at 8:48
  • 2
    I do not know Pang at all, but recently came across one of his meta posts from last year. And wow, that's a lot of flags. – JonathanDavidArndt Apr 5 '18 at 10:53
  • 2
    @BhargavRao I edited in a link to a longer list. – user315433 Apr 5 '18 at 18:00
  • The Google script is very nice! But how do we know how reliable it is? Where is the source? – JonathanDavidArndt Apr 6 '18 at 12:17
4

There's no such list, but will a little bit of JavaScript it's possible to generate this list yourself. You'll need to visit the Marshal badge page (on the target site), open the browser console and execute the code below. Sometimes, a little patience is required (generating this list with 2910 top flaggers on Stack Overflow took about 15 minutes), but the console will give some indication about the progress and finally spit out some Markdown you can use to update the top list.

// Execute this snippet in the browser console on the Marshal badge page,
// e.g. https://meta.stackexchange.com/help/badges/160/marshal
// It'll probably work on Deputy as well, but then it takes longer...

// { relative URL to profile page -> display name }
var users = {};
// { relative URL to profile page -> flag count }
var flagCounts = {};
// [ relative URL to profile page ]
var urls = [];

// Determine current & last page number
let pager = $("div.pager span.current");
let currentPage = pager.length == 0 ? 1 : parseInt(pager[0].innerText);
var lastPage = 1;
let pageLinks = $("div.pager").find("a");
let baseLink = window.location.href.split('?')[0] + "?page=";
if (pageLinks.length != 0) {
  // The last link is 'next', unless we're on the last page itself.
  if ("next" == pageLinks[pageLinks.length - 1].innerText) {
    // We need the one before to determine the # of pages.
    lastPage = parseInt(pageLinks[pageLinks.length - 2].getAttribute("href").split("?page=")[1]);      
  } else {
    lastPage = currentPage;
  }
}

// Process a single user
function processUser(index) {
  if (index == urls.length) {
    // All profiles have been read

    // Sort by # of helpful flags
    urls.sort(function (a, b) {
      return flagCounts[b] - flagCounts[a];
    });

    // Output to console
    var output = "";
    for (var rank = 0; rank < urls.length; rank++) {
      let topFlagger = urls[rank];
      output += (rank + 1) + ". [" + users[topFlagger] + "](" + topFlagger + "), " + flagCounts[topFlagger] + " helpful flags\n";
    }
    console.log(output);
    return;
  }

  if (index > 0 && index % 10 == 0) {
    console.log(index + " top flagger details fetched");
  }

  // Fetch profile page
  let url = urls[index];
  $.get(url + "?tab=topactivity", function (data) {
    // NOTE: second cell (the last cell is the # of unhelpful flags, if you're a moderator on that site)
    let label = $(data).find("div[title='Total number of raised flags marked useful'] > div:nth-child(2)").text().trim();
    flagCounts[url] = parseInt(label.replace(",", ""));
    processUser(++index);
  }).error(function(xhr, status, error) {
    console.error(url + ': ' + status + ' - ' + error);
    processUser(++index);
  });   
}

// Process a single page of users with the badge
function processPage(page, lastPage) {
  if (page > lastPage) {
    // Fetch profile pages
    let numberOfUsers = Object.keys(users).length;
    if (numberOfUsers == 0)
      return;
    console.log("Found " + numberOfUsers + " top flaggers");
    urls = Object.keys(users);
    processUser(0);
    return;
  }
  console.log("Page " + page);
  let selector = "div.user-details a";
  if (page == currentPage) {
    // Process current page
    $(selector).each(function() {
      users[$(this).attr("href")] = $(this).text();
    });
    processPage(page + 1, lastPage);
  } else {
    // Fetch page
    $.get(baseLink + page, function (data) {
      // Process fetched page
      $(data).find(selector).each(function() {
        users[$(this).attr("href")] = $(this).text();
      });
      processPage(page + 1, lastPage);
    });
  }
}

// Start processing pages 
processPage(1, lastPage);

Some notes:

  • Profile links are relative, so if you want to update the list above, you'll need to find /users/ and replace it with https://stackoverflow.com/users/.
  • The script works for Deputy as well, but this will of course take more time. You might even get rate-limited because the script has to fetch each profile page separately.
  • Some users have less helpful flags than the badge requirement; this is due to an old bug in the system, cf. I got the Marshal badge with less than 500 helpful flags.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .