Skip to content

Instantly share code, notes, and snippets.

@double-beep
Created October 9, 2019 20:30
Show Gist options
  • Select an option

  • Save double-beep/4e7b9c4539e45cfa9534192f05faca1e to your computer and use it in GitHub Desktop.

Select an option

Save double-beep/4e7b9c4539e45cfa9534192f05faca1e to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Show me the votes
// @version 1.0
// @description Automatically shows votes on posts where the score is lower than 0
// @author double-beep
// @include /^https?:\/\/\w*.?(stackoverflow|stackexchange|serverfault|superuser|askubuntu|stackapps)\.com\/(questions|posts|review|tools)\/(?!tagged\/|new\/).*/
// @grant none
// ==/UserScript==
(function() {
'use strict';
$(document).ready(function() {
var sitename = window.location.hostname.replace(/(?:\.stackexchange)?\.(com|net)/, '');
$(".js-voting-container").each(function() {
var postId = $(this).attr("data-post-id");
$.get(
`http://api.stackexchange.com/2.2/posts/${postId}?order=desc&sort=activity&site=${sitename}&filter=!ajOV3J7svw34WD`,
function(results) {
$(".js-voting-container .js-vote-count").html(results.items[0].score);
}
)
})
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment