Created
May 21, 2018 14:17
-
-
Save PeteDevoy/2fcb3d254961c4261ab3aa6a3975f374 to your computer and use it in GitHub Desktop.
Show seconds worked on which days from WakaTime JSON
This file contains hidden or 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
//for chrome/chromium browser (verified working May 2018) | |
/* | |
Shows a table of which dates WakaTime tracked work on a project and | |
how many seconds were tracked on that date. How to use: | |
disable any json formatting extensions | |
use dev tools to view network requests | |
open project page in WakaTime | |
open AJAX request in new tab | |
paste below into dev console in that tab | |
*/ | |
(function(){ | |
var data = JSON.parse(document.querySelector('pre').innerText); | |
var output = []; | |
var project = document.location.href.split('project=')[1].split('&')[0]; | |
data.data.forEach((entry) => { | |
if (entry.grand_total.total_seconds > 0) { | |
output.push({"date": entry.range.date, "seconds": entry.grand_total.total_seconds}); | |
} | |
}); | |
console.log('%c' + project, "font-size:2em;"); | |
console.table(output, ["date", "seconds"]); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As HTML: