182

Screenshot

About

The vote counts are a great tool to determine whether an answer is disputed or not. Unfortunately, not many of us have enough time to join all Stack Exchange websites and get 1000 reputation.

This script unlocks the "View Vote counts" feature for those who are not logged in or don't have 1k reputation. The look and feeling of the feature is identical to the original one.

Recognises posts at questions, question lists, /review/ pages and search results.

License

Creative Commons 3.0 SA - Same as footer. You may modify and distribute this script S, provided that you mention the original author of the script A.

Download

The code is available in three forms:

Platform

The code is OS-independent. It should at least work in the following browsers:

  • Firefox 3.0 - 64
  • Opera 9.00 - 12.00
  • Chrome 1 - 71
  • Internet Explorer 7 - 10
  • Edge 12 - 15
  • Safari 3.2 - 5.1

Contact

Please send your feedback to [email protected].

Code

This script is written in JavaScript and a bit of jQuery. It depends on the Stack Exchange API (v2, JSONP).

When the Vote counts feature is disabled, the Vote counts buttons don't have a tooltip. The script checks for the existence of the tooltip, and adds the feature when necessary. If the tooltips already exist, the script does not add any visible modifications to the page.

A detailed explanation of the code is listed in the source code (direct link, or via the overview page). The change log is listed at the overview page.

38
  • 1
    Seems buggy. Screws with upvote and downvote buttons. Count breaks if you mess with screwed up upvote and downvote buttons. But, it does what it's supposed to... thanks :)
    – GGG
    Commented Feb 6, 2012 at 21:55
  • @GGG I have uploaded a new version, which adds a CSS-fix for IE7-. Do you still observe the bug? If yes, please specify your browser version and OS.
    – Rob W
    Commented Feb 6, 2012 at 23:18
  • 6
    Nice work, Rob! If you wanted, you could save some bytes by omitting type="text/css" on the <style> element — it’s optional in HTML5 anyway, and it still works in all browsers without. Commented Feb 13, 2012 at 12:50
  • 8
    Good script. Makes me wonder, if the information is available via the API anyway, then why does SE hide it? Commented Oct 3, 2012 at 14:11
  • 6
    @user2428118 See Jeff's answer at meta.stackoverflow.com/a/1007/169101.
    – Rob W
    Commented Oct 3, 2012 at 14:57
  • 2
    @RobW My apologies, I didn't realize that you had to click on the counters for the upvotes/downvotes to appear. I assumed it would automatically replace all the counters. But no matter, this is a great extension! Thanks :)
    – Paul T.
    Commented Jan 4, 2013 at 15:44
  • 2
    Just had the thought, I'd certainly like to use an app/script which would alert me to any questions/answers that have been downvoted with no comment given so I could counter it and upvote them since that form of downvoting practice doesn't help out the user who posted the question/answer thus fails to support the community.
    – Myzifer
    Commented Jun 14, 2013 at 12:59
  • 10
    @Myzifer Don't practice pity upvoting, that's harmful. If you get alerted of all downvotes, your computer would explode on Stack Overflow, given the huge volume of questions. Lots has already been said about this topic, just search for "pity upvoting" or "sympathy upvoting" on meta.stackoverflow.com.
    – Rob W
    Commented Jun 14, 2013 at 13:13
  • 2
    I wouldn't think of it as pity or sympathy but more re-balancing as such downvotes serve no purpose being there without feedback.
    – Myzifer
    Commented Jun 14, 2013 at 13:23
  • 1
    @DImension10AbhimanyuPS Added Mathoverflow.net to list of sites.
    – Rob W
    Commented Sep 5, 2013 at 10:55
  • 2
    Is this even allowed?
    – clickbait
    Commented Jun 7, 2016 at 4:13
  • 1
    @NarawaGames Yes, this is allowed.
    – Rob W
    Commented Jun 7, 2016 at 7:25
  • 2
    When I first saw this script I assumed it would just show upvotes and downvotes when the page loaded, but it turns out you need to click on the vote count to see them. Even though this is normal for SE I find it kind of counter-intuitive and I'll leave this comment here in case anybody gets stuck.
    – jrh
    Commented Jun 22, 2017 at 13:14
  • 1
    @CalvT When you have 1k+ rep, the standard SE mechanism is used if available. The script only activates if the vote counter does not appear to support vote totals (detected by the absence of a tooltip on the vote counter).
    – Rob W
    Commented Dec 23, 2018 at 13:21
  • 1
    @user202729 The script was already supposed to ignore sites where the user has a privilege. But I see that the check is no longer working, I'll fix this with the next update (along with dark theme support).
    – Rob W
    Commented Jul 5, 2020 at 10:56

11 Answers 11

17

Bug Report ()

  • Go to a tag page, for example this one.
  • You will see a question, such as this:
  • Find the vote and answer count on the left.
  • Click the vote count.
  • You will then get a message in the error console that says Post ID not found! Please report this at http://stackapps.com/q/3082/9699

So now I'm reporting it.

2
  • 1
    Thanks for reporting, I've even forgotten that I've added that link to the error message. Turns out to be useful ;) I'll check it out later.
    – Rob W
    Commented May 22, 2013 at 13:17
  • 2
    Fixed :) The last update (v1.5.3) introduces a feature which is not even available to 1k+ users: View vote totals at the questions list and search results.
    – Rob W
    Commented May 23, 2013 at 9:54
9

Feature Request

Can we get a setting to show the counts automatically without clicking?

2
  • 34
    Automatically showing up/down votes puts lots of load on the Stack Exchange API, so I'm probably not going to add the feature. Besides, the net vote count is usually the most interesting number. Downvotes are only relevant if you want to see whether the contents of a post are disputed.
    – Rob W
    Commented Jun 11, 2013 at 15:42
  • @RobW: Perhaps only show vote count for directly accessed questions (by "direct" I mean excluding question feed)?
    – user598527
    Commented Oct 21, 2017 at 10:00
9

Bug report ()

It doesn't work for the new Stack Overflow em Português.

The following @match entries in the script:

// @match          http://stackoverflow.com/questions/*
// @match          http://meta.stackoverflow.com/questions/*
// @match          http://stackoverflow.com/review/*
// @match          http://meta.stackoverflow.com/review/*
// @match          http://stackoverflow.com/search*
// @match          http://meta.stackoverflow.com/search*

Should be changed to:

// @match          http://*.stackoverflow.com/questions/*
// @match          http://*.stackoverflow.com/review/*
// @match          http://*.stackoverflow.com/search*
 

This will catch SO and SOpt and their respective Meta sites.

2
  • 1
    Thanks for reminding me, I've just updated the extension and uploaded the updated script to Greasyfork: greasyfork.org/en/scripts/….
    – Rob W
    Commented Oct 31, 2014 at 21:18
  • 1
    Bravo, spreading the word, I mean, espalhando a notícia :)
    – brasofilo
    Commented Oct 31, 2014 at 21:27
6

Bug Report ()

This script is no longer working as of yesterday (12/20/2018) for me on any SE site, it looks like StackExchange redesigned the voting buttons. Clicking on the score of a post now has no effect whatsoever. I'm using Chrome 71 on Windows 10 if it matters.

It looks like this script was broken by the same UI change that made the vote buttons bigger.

New (broken): A screenshot of the new vote buttons Old: A screenshot of the old buttons

8
  • yup, so annoying!
    – Welz
    Commented Dec 21, 2018 at 16:17
  • Happens to me too (Chrome, Mac). Commented Dec 23, 2018 at 3:26
  • @MonicaCellio, I really missed this script and Rob W hasn't been around for a month and a half. So I wrote a script myself. You can find it at stackapps.com/questions/8166/…. Commented Dec 23, 2018 at 7:09
  • @BrockAdams I'm still around. I'll look into this, update the script and publish an updated extension.
    – Rob W
    Commented Dec 23, 2018 at 12:17
  • @RobW The Chrome extension doesn't look like it's been updated yet.
    – EKons
    Commented Dec 23, 2018 at 15:05
  • 1
    @EKons There may be some time (hours) between me publishing and the extension actually updating. The Chrome Web Store listing has been updated, at least.
    – Rob W
    Commented Dec 23, 2018 at 15:37
  • Working for me now in Chrome. Thanks for the quick fix, @RobW! Commented Dec 23, 2018 at 18:58
  • @RobW I can confirm that the userscript is working again, thanks!
    – jrh
    Commented Dec 26, 2018 at 14:45
5


Is it possible to view vote counts on Area51 proposal questions?
It would be helpful to see where the followers are being stingy with each other, and then open a question to discuss it.

4
  • 1
    No, because the Stack Exchange API does not have any information about area51: api.stackexchange.com/docs/sites#pagesize=99999&filter=!*L6X1NvG5lnyyK4-&run=true
    – Rob W
    Commented Jan 5, 2016 at 21:32
  • Darn, that's too bad.
    – user34600
    Commented Jan 5, 2016 at 21:36
  • 2
    If enough people upvote (hint, hint) the related feature request and supporting posts, then they have to add Area51 support. Right? Right!? (^_^) Commented Jan 5, 2016 at 22:07
  • I guess 1000 rep doesn't work there, then. That is unfair, although separate vote counts there aren't the immediate need.
    – EKons
    Commented Jul 11, 2016 at 11:56
5

Bug report ()

When the new beta dark mode on Stack Overflow is enabled, the colors have poor contrast. Of course they are still fine in the usual light mode.

enter image description here

1
  • I've fixed this in the latest update. The user script has been updated, the Chrome extension is pending review approval.
    – Rob W
    Commented Jul 5, 2020 at 12:35
2

Use the true minus sign, not the hyphen:

--- current
+++ fixed
@@ -174,7 +174,7 @@
                 json = json.items[0];
                 var up = json.up_vote_count, down = json.down_vote_count;
                 up = up ? '+' + up : 0;       /* If up > 0, prefix a plus sign*/
-                down = down ? '-' + down : 0; /* If down > 0, prefix a minus sign */
+                down = down ? '−' + down : 0; /* If down > 0, prefix a minus sign */
                 $this.parent().find('.message-error').fadeOut('fast', function() {
                     $(this).remove();
                 });
2

()

After the colors change announced on MSE, the vote totals don't have much color. Compare, for example, StackApps (with the userscript)

enter image description here

To MSE (where I have enough rep)

enter image description here

0

Feature Request

Can you include new images for this script?

Like this

1
  • 4
    Which new images? The script itself does not have any images. Or do you mean the screenshot? I'll leave it at the current state since it is still recognizable.
    – Rob W
    Commented Aug 21, 2016 at 9:14
0

If you show the vote count, then vote on the post, it will change back to just showing the net count and you need to reload to get the vote count again.

0
0

If you try to fetch vote counts on your own deleted posts on a site where you don't have access to the "Established User" privilege, the vote counts will never finish loading, and will continue to look like the image below (although the 3 dots will keep moving).

enter image description here

You must log in to answer this question.

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