Created
April 4, 2014 20:50
-
-
Save joom/9982861 to your computer and use it in GitHub Desktop.
Wesleyan University Timeclock Total Hours Calculator
This file contains 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
/* | |
//Human readable version: | |
var frame = document.querySelectorAll('frame')[1].contentWindow.document; | |
var list = Array.prototype.slice.call(frame.querySelectorAll('center tr')); | |
list = list.slice(1); | |
list.map(function(tr) { | |
return parseFloat(tr.querySelectorAll('td:nth-child(4)')[0].innerText); | |
}).reduce(function(pre, cur){ | |
return pre + cur; | |
}); | |
*/ | |
//minified version: | |
Array.prototype.slice.call(document.querySelectorAll("frame")[1].contentWindow.document.querySelectorAll("center tr")).slice(1).map(function(e){return parseFloat(e.querySelectorAll("td:nth-child(4)")[0].innerText)}).reduce(function(e,t){return e+t}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy the minified line to JavaScript console when you are in the Timeclock page.