Guest User

Untitled

a guest
May 26th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. //for chrome/chromium browser (verified working May 2018)
  2.  
  3. /*
  4. Shows a table of which dates WakaTime tracked work on a project and
  5. how many seconds were tracked on that date. How to use:
  6.  
  7. disable any json formatting extensions
  8. use dev tools to view network requests
  9. open project page in WakaTime
  10. open AJAX request in new tab
  11. paste below into dev console in that tab
  12. */
  13.  
  14. (function(){
  15. var data = JSON.parse(document.querySelector('pre').innerText);
  16. var output = [];
  17. var project = document.location.href.split('project=')[1].split('&')[0];
  18. data.data.forEach((entry) => {
  19. if (entry.grand_total.total_seconds > 0) {
  20. output.push({"date": entry.range.date, "seconds": entry.grand_total.total_seconds});
  21. }
  22. });
  23. console.log('%c' + project, "font-size:2em;");
  24. console.table(output, ["date", "seconds"]);
  25. })()
Add Comment
Please, Sign In to add comment