[Request] Time-tracking on reviews and lessons

Hi, I often wonder how long I usually spend on WaniKani doing lessons and reviews every day/week. It would help predict how much time future days would require and generally help with time management. My best solution so far has been to use a stop watch whenever I do reviews and lessons, which is… not very convenient. It would be great to have an add-on that tracks how long you spend doing reviews and lessons, maybe also allowing for daily/weekly averages.  

1 Like

What a fabulous idea!

Personally, I’d be most interested in total time spent on WK.  I’ve been here for “1 year 5 months”, but how much actual time spent?

I’ve got too much other coding going on right now to make something very complicated out of this one.  But I’ll post some starter code below, in case someone wants to build on it.

http://pastebin.com/htzJnSwU

[EDIT: Thanks @sivorn for recommending pastebin. Don’t know what I was thinking :slight_smile: ]

[EDIT2:  I’ve got this running on my laptop now.  Works great, actually tracks, but doesn’t display anything anywhere yet.]

Love the idea of this as well!

Maybe you could just throw that in a pastebin to link rfindley :slight_smile:

rfindley said... http://pastebin.com/htzJnSwU

[EDIT: Thanks @sivorn for recommending pastebin. Don’t know what I was thinking :slight_smile: ]

[EDIT2:  I’ve got this running on my laptop now.  Works great, actually tracks, but doesn’t display anything anywhere yet.]

 Ah, that’s better. I was trying to make heads or tails of how to put that into a script. 

Glad the idea is appreciated. Suffice it to say I love you rfindley :D 

Generally just knowing how much time I spend on WK would be awesome, totals, averages, across lessons, reviews, and even the forum. I’m a stat junkie, I should probably learn to code given all the things I want and ideas I have. But time… And Japanese. 

@HigginsHere Does your name have any connection to the Higgs boson? o_o

Conker said... @HigginsHere Does your name have any connection to the Higgs boson? o_o
 Actually, it's two-sided: Higgins is my last name, and I just happen to love the Higgs boson particle! 


Nah jk, it's just my last name. The Higgs boson is pretty sweet too, tho. 
HigginsHere said...
rfindley said... http://pastebin.com/htzJnSwU

[EDIT: Thanks @sivorn for recommending pastebin. Don’t know what I was thinking :slight_smile: ]

[EDIT2:  I’ve got this running on my laptop now.  Works great, actually tracks, but doesn’t display anything anywhere yet.]

 Ah, that’s better. I was trying to make heads or tails of how to put that into a script. 

Glad the idea is appreciated. Suffice it to say I love you rfindley :D 

Generally just knowing how much time I spend on WK would be awesome, totals, averages, across lessons, reviews, and even the forum. I’m a stat junkie, I should probably learn to code given all the things I want and ideas I have. But time… And Japanese. 
 Post all your requests on the forum! I have some time on my hands for the coming weeks.

Mempo said... Post all your requests on the forum! I have some time on my hands for the coming weeks.
I pondered this a bit more, and realized a few things that probably need to be considered:

* Multiple open tabs doesn't equal simultaneous time spent.  Could detect when a tab is inactive (I've seen that done before), and pause the timer.
* Closing multiple tabs at once (when browser closes) would result in multiple tabs trying to add their time at the same time.  Could cause problems.
* Do all browsers run the 'unload' event when you close the browser?  I know Chrome does, not sure about others.  If not, probably need a periodic save.
* Browsers usually have 5-10MB of localStorage per domain.  Gotta share that space will ALL userscripts on a domain.  But daily stats wouldn't take up very much space, even after a few years (maybe 250k after 5yrs).  So there's all kinds of stuff you could do with the daily stats.
* I've noticed in the past that WK doesn't give you an error page if you navigate to some random URL, like https://www.wanikani.com/timespent.  You just get a blank page.  This means a userscript could populate whatever it wants on its own URL, and it would look like it's actually part of WK.  How awesome is that!?  And you could just add a link to it in the drop-down menu.
rfindley said...
Mempo said... Post all your requests on the forum! I have some time on my hands for the coming weeks.
I pondered this a bit more, and realized a few things that probably need to be considered:

* Multiple open tabs doesn't equal simultaneous time spent.  Could detect when a tab is inactive (I've seen that done before), and pause the timer.
* Closing multiple tabs at once (when browser closes) would result in multiple tabs trying to add their time at the same time.  Could cause problems.
* Do all browsers run the 'unload' event when you close the browser?  I know Chrome does, not sure about others.  If not, probably need a periodic save.
* Browsers usually have 5-10MB of localStorage per domain.  Gotta share that space will ALL userscripts on a domain.  But daily stats wouldn't take up very much space, even after a few years (maybe 250k after 5yrs).  So there's all kinds of stuff you could do with the daily stats.
* I've noticed in the past that WK doesn't give you an error page if you navigate to some random URL, like https://www.wanikani.com/timespent.  You just get a blank page.  This means a userscript could populate whatever it wants on its own URL, and it would look like it's actually part of WK.  How awesome is that!?  And you could just add a link to it in the drop-down menu.
 Hehe,  actually was referring to requests in general. I could try this, but i only started learning Javascript this week, so it might be above my skill level. I'll give it a shot, but won't necessarily commit.

But holy shit, you're right. That blank page you get when using an invalid URL is gold. I'll use that in the future.
Mempo said...

 but i only started learning Javascript this week, so it might be above my skill level.

 Hehe… Javascript is a deep, dark hole… one I’m still working my way out of.  Fun, but occasionally maddening :slight_smile:

Part of the reason I’m doing so much scripting right now is that I want to be genuinely good at Javascript, not just okay, before I jump full speed into my latest project.  I’m mostly a C/C++ embedded systems developer.

HigginsHere said...
Conker said... @HigginsHere Does your name have any connection to the Higgs boson? o_o
 Actually, it's two-sided: Higgins is my last name, and I just happen to love the Higgs boson particle! 


Nah jk, it's just my last name. The Higgs boson is pretty sweet too, tho. 
 I see many cats in this thread, but you are, by far, the coolest. =D

I wish I could code like this… Or like anything other than “Hello World”! Playing with networks and switches is fun, but to be able to program and make things do stuff the way you want it to?!

sigh oh the dream. 

AlaskanDSM said... I wish I could code like this... Or like anything other than "Hello World"! Playing with networks and switches is fun, but to be able to program and make things do stuff the way you want it to?!

*sigh* oh the dream. 
 WHAT? Did you know I only started learning Javascript/JQuery a few weeks ago? And now I've already written three user scripts! Don't know HTML/CSS? I only started learning that two months ago and now I got my own personal sweet-ass website portfolio YO!

It's all about the attitude. DON'T LET YOUR DREAMS BE DREAMS MAN!

shia labeouf motivation just do it motivate



Consider yourself enlightened. Thank me later.

I love that damn video.

Not to thread-jack, but what resources did you use to get on your path? I would greatly appreciate some direction as there is obviously a billion things out there…

AlaskanDSM said... I love that damn video.

Not to thread-jack, but what resources did you use to get on your path? I would greatly appreciate some direction as there is obviously a billion things out there...
I learned HTML/CSS already a few times during the past years but didn't do much with it. For my recent effort in relearning it I took a college course. And then I just build a portfolio website as practice displaying other stuff I programmed etc.

The funny thing is, next semester I'll take a course on Javascript/JQuery, but I wanted to write user script now (Christmas break = lots of free time), so I started learning it on my own.

But assuming you're unable to take such courses I'd recommend Codecademy. It's great for absolute beginners. I'll warn you though: if you have any kind of programming experience, this could feel excruciatingly slow (it did for me), but just like WK it's just structured very well and I know I'm gonna learn the very basics I need to know. From there, I just started reading other peoples user scripts. When I had an idea I'd look for a script that effected the same section of a page or had similar effects and just kinda winged it.

tl;dr
I did all tutorials on Codecademy.
Another fun introduction to javascript (or programming in general) would be http://codecombat.com/

Anyone wanting to take a crack at this yet? :smiley:

HigginsHere said... Anyone wanting to take a crack at this yet? :D
 Have you noticed the Egg Timer script by horusscope?
https://greasyfork.org/en/scripts/16316-wanikani-egg-timer

It's not ideal though, because you'll still have to write down the time after each review.

@Mempo
Taking courses is great of course, but I always joke with other programmers that you learn everything in college except how to solve a new problem.
If you really want to learn, the shortest route is making things. Sure, the first few won’t be the most epic masterpieces mankind has ever known, but you’ll learn a lot and the internal motivation is really powerful; the satisfaction of even minor successes will super-charge your memory. Sometimes it’s difficult to think of something you want to make, but I suppose this is a problem in every craft, whether it’s writing, painting, modeling, woodworking, construction, architectural drafting, or anything really. The way you develop genuine talent is straight practice.
So do absolutely learn the foundational knowledge from schoolwork, but don’t let it stop you! Don’t wait!

It’s kind of embarrassing but my first learning experiences were hacks. I had to learn all kinds of undocumented knowledge, or knowledge that was so obscure that even on the modern internet it’s not really very available. Things like how to detour functions in the IAT, the PE format, how to proxy a program through a local service by hijacking its winsock.connect, ahhh I’m going off track. Just getting the first prototypes of my program to work took weeks of spending ‘all day’ making no progress whatsoever. What kept me going was that no one else had what I wanted, or probably other reasons, who knows how the subconscious really works. Still, all the hours and hours I put into just writing code are what made me who I am today, not that you can see of course, but if I had only gone to school I probably would have given up or gotten nowhere. I bet it’s the same for artists, too.

I wouldn’t pick something insanely difficult as a start though, I think making userscripts ranks great on the learning chain. Javascript is a good language with great roots. When you make a script, you don’t actually have to have a goal, just like with drawing or something. All you have to do is play with it and have fun :slight_smile:
gl ~

Oh also,
maybe I can extend my script later to save a list of sessions.
I’ll check back after work if no one has made this.

I suck at design though, if someone else should makes a mockup of the appearance that would save me infinite time