Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YellowAfterlife/0e8589a0aef091c2bbb8 to your computer and use it in GitHub Desktop.
Save YellowAfterlife/0e8589a0aef091c2bbb8 to your computer and use it in GitHub Desktop.
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