Created
March 20, 2016 22:52
-
-
Save YellowAfterlife/0e8589a0aef091c2bbb8 to your computer and use it in GitHub Desktop.
The manual tab refreshing syndrome seems a little too common.
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 Greenlight stats refresher | |
// @namespace http://yal.cc | |
// @version 1.0 | |
// @description Reloads stats-tabs once per 3 minutes and displays yes-votes and comments in the tab title. | |
// @author YellowAfterlife | |
// @match http://steamcommunity.com/sharedfiles/filedetails/stats/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ | |
'use strict'; | |
var rightContents = document.getElementById("rightContents"); | |
if (rightContents) { | |
var bigNums = rightContents.getElementsByClassName("bigNum"); | |
var sectionTabCtr = document.getElementsByClassName("sectionTabs")[0]; | |
var sectionTabs = sectionTabCtr.getElementsByClassName("sectionTab"); | |
var yesVotes = parseInt(bigNums[2].textContent); | |
var comments = parseInt(sectionTabs[3].getElementsByClassName("tabCount")[0].textContent) | |
document.title = "+" + yesVotes + "; " + comments; | |
setTimeout(function() { | |
document.location.reload(); | |
}, 3 * 60 * 1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment