Created
October 9, 2019 20:30
-
-
Save double-beep/4e7b9c4539e45cfa9534192f05faca1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==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