Skip to content

Instantly share code, notes, and snippets.

@nikolaplejic
Created August 26, 2011 09:40
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 nikolaplejic/1173078 to your computer and use it in GitHub Desktop.
Save nikolaplejic/1173078 to your computer and use it in GitHub Desktop.
Quick & dirty operating system statistics for usesthis.com
/*
step 1: open http://usesthis.com/interviews/
step 2: open firebug (or chrome inspector)
step 3: inject jquery (*)
step 4: run the script below
results (Aug 26th, 2011) -- total: 156 | windows: 34, linux: 13, mac: 130
(*)
var script=document.createElement('script');
script.src = "http://code.jquery.com/jquery-latest.min.js";
var head=document.getElementsByTagName('head')[0];
head.appendChild(script);
*/
var mac = 0;
var linux = 0;
var windows = 0;
var total = 0;
$("#interviews > li").each(function(i) {
total++;
$(".categories li a", this).each(function(i) {
switch ($(this).html()) {
case "windows":
windows++;
break;
case "linux":
linux++;
break;
case "mac":
mac++;
break;
}
});
});
console.log("total: %o | windows: %o, linux: %o, macos: %o", total, windows, linux, mac);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment