Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The manual tab refreshing syndrome seems a little too common.
// ==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
You can’t perform that action at this time.