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 rob@robwu.nl.

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.

Rob W
  • 2,669
  • 3
  • 21
  • 19
  • 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 Feb 06 '12 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 Feb 06 '12 at 23:18
  • Yep, it's still messed up. Click the vote count, then click vote up a few times, then click the vote count again. I'm using a somewhat old chromium on a somewhat old ubuntu. 16.0.912.75 (Developer Build 116452 Linux) Ubuntu 11.04 – GGG Feb 07 '12 at 01:22
  • @GGG Updated and uploaded code. Now, you can also show vote counts after voting. I notice that, after voting, the SE API does not necessarily show the newest vote counts. After a few minutes, the requested counts are correct, though. This might be a bug in the SE API. – Rob W Feb 07 '12 at 16:05
  • It appears to be mostly fixed. There seems to be a problem where it appears to let you remove upvotes after the time for removing them has passed. Of course they aren't actually removed, but have the appearance of being removed. That's pretty trivial though. Nice work :) – GGG Feb 07 '12 at 19:04
  • 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. – Mathias Bynens Feb 13 '12 at 12:50
  • 8
    Good script. Makes me wonder, if the information is available via the API anyway, then why does SE hide it? – user2428118 Oct 03 '12 at 14:11
  • 6
    @user2428118 See Jeff's answer at http://meta.stackoverflow.com/a/1007/169101. – Rob W Oct 03 '12 at 14:57
  • @RobW Installed it on Chrome 23.0.1271.97 (stable) and it doesn't seem to work at all :( – Paul T. Jan 04 '13 at 15:12
  • @PaulT. Works fine here. If you're trying it in incognito mode, you have to check the tick before "Allow in incognito" at chrome://extensions/. – Rob W Jan 04 '13 at 15:16
  • 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. Jan 04 '13 at 15:44
  • Took me a minute too @PaulT. – THE JOATMON Jun 11 '13 at 15:30
  • 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 Jun 14 '13 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 Jun 14 '13 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 Jun 14 '13 at 13:23
  • Nice! Can't believe there were no downvotes though (haha). –  Sep 04 '13 at 15:40
  • Now you just need to do the same for close votes... and tag wiki edits. : ) –  Sep 04 '13 at 15:40
  • It seems this doesn't work for Math Overflow : ( . –  Sep 05 '13 at 10:42
  • 1
    @DImension10AbhimanyuPS Added Mathoverflow.net to list of sites. – Rob W Sep 05 '13 at 10:55
  • Will this script be disabled on sites where I have sufficient reputation already? – Duncan Jones Jan 14 '14 at 10:32
  • @Duncan Yes. See the second-to-last paragraph of the app listing. – Rob W Jan 14 '14 at 10:33
  • Thanks, @RobW. I read that paragraph but thought it related to whether that feature was enabled (in general) on some smaller sites. More coffee needed. – Duncan Jones Jan 14 '14 at 10:35
  • Would it be possible for the API url to be switched to https? This breaks when SSL is used on SE sites. –  Feb 21 '14 at 00:45
  • @KevinBrown Added https support in v1.5.5. – Rob W Feb 21 '14 at 09:36
  • People are recommending Greasy Fork as a good UserScripts.org alternative (see this blogpost for example). – Martijn Pieters Jul 26 '14 at 12:57
  • Hi, Rob, cool stuff, thx :) Feature-request: include [pt.so] on the list. I did a *.stackoverflow.com and removed meta.stackoverflow.com to handle this. Cheers! – brasofilo Aug 22 '14 at 14:15
  • 2
    Is this even allowed? – clickbait Jun 07 '16 at 04:13
  • 1
    @NarawaGames Yes, this is allowed. – Rob W Jun 07 '16 at 07:25
  • Area 51 example questions don't work. – EKons Jul 11 '16 at 11:52
  • @Fiksdal This was asked before, see my answer at https://stackapps.com/a/4147/9699 – Rob W Oct 12 '16 at 10:27
  • 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 Jun 22 '17 at 13:14
  • The bookmarklet doesn't appear to work in Chromium 61.0.3163.79. Unlike the extension (which works OK), with bookmarklet the three dots blink indefinitely without giving the split. – Ruslan Feb 16 '18 at 09:28
  • @Ruslan Edit the bookmarklet and replace all "http:" with "https:". – Rob W Feb 16 '18 at 21:09
  • What happens if I have over 1k rep on a site? Does this replace the standard SE mechanism? If so, it would be nice to have the option of a button to show vote counts, so that on sites that I have 1k I can use the default SE, and on the rest I use the separate button. Thanks! – CalvT Dec 19 '18 at 18:21
  • 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 Dec 23 '18 at 13:21
  • Can you please make this a Chrome Extension? – Aryan May 12 '20 at 18:35
  • @AryanBeezadhur There is already a Chrome extension. See the link in the original post. – Rob W Jun 01 '20 at 21:27
  • 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 Jul 05 '20 at 10:56

10 Answers10

16

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.

Doorknob
  • 1,299
  • 8
  • 19
  • 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 May 22 '13 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 May 23 '13 at 09:54
8

Feature Request

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

THE JOATMON
  • 199
  • 1
  • 4
  • 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 Jun 11 '13 at 15:42
  • @RobW: Perhaps only show vote count for directly accessed questions (by "direct" I mean excluding question feed)? – user598527 Oct 21 '17 at 10:00
8

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.

brasofilo
  • 992
  • 7
  • 22
  • 1
    Thanks for reminding me, I've just updated the extension and uploaded the updated script to Greasyfork: https://greasyfork.org/en/scripts/6192-stack-exchange-view-vote-totals-without-1000-rep. – Rob W Oct 31 '14 at 21:18
  • 1
    Bravo, spreading the word, I mean, espalhando a notícia :) – brasofilo Oct 31 '14 at 21:27
5

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

Rob W
  • 2,669
  • 3
  • 21
  • 19
jrh
  • 151
  • 1
  • 5
4


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.

Brock Adams
  • 12,901
  • 5
  • 38
  • 64
4

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

Rob W
  • 2,669
  • 3
  • 21
  • 19
joulev
  • 141
  • 2
  • I've fixed this in the latest update. The user script has been updated, the Chrome extension is pending review approval. – Rob W Jul 05 '20 at 12:35
1

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

cocomac
  • 468
  • 1
  • 9
1

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();
                 });
user3840170
  • 335
  • 1
  • 9
0

Feature Request

Can you include new images for this script?

Like this

  • 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 Aug 21 '16 at 09: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.

Anonymous
  • 479
  • 1
  • 3
  • 11