Skip to content

Instantly share code, notes, and snippets.

@ronyx69
Last active December 28, 2018 13:08
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 ronyx69/392e4eae370624e489a2b562e26246ee to your computer and use it in GitHub Desktop.
Save ronyx69/392e4eae370624e489a2b562e26246ee to your computer and use it in GitHub Desktop.
Prints out a string of workshop stats (name, days, visitors, subs (current), subs (total), favs (current), favs (total), positive ratings, negative ratings), ready to be pasted into google sheets and must be automatically seperated by @ character. Run in developer console while item stats page is open.
(function(){ 'use strict';
var headingNodes = [], results, link, tags = ['td'];
tags.forEach(function(tag) {
results = document.getElementsByTagName(tag);
Array.prototype.push.apply(headingNodes, results);
});
console.log(
document.getElementsByClassName("workshopItemTitle")[0].innerHTML + '@' +
document.getElementsByClassName("littleNum")[0].innerHTML.split(" ")[1] + '@' +
results[1].innerHTML + '@' + results[3].innerHTML + '@' + results[5].innerHTML +
'@' + results[7].innerHTML + '@' + results[9].innerHTML + '@' +
results[13].innerHTML.substring(0, results[13].innerHTML.indexOf(' ')) + '@' +
results[15].innerHTML.substring(0, results[15].innerHTML.indexOf(' '))
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment