[Unsupported] Dashboard Userscript: Leech, Apprentice, and Guru detail (aka SRS level progress)

I think the topic should be renamed to

[Userscript] Leech, Apprentice, and Guru detail on Dashboard (aka SRS level progress)

Because, the reason I install this is because of leeches.

Also, please add a link to [Unsupported] Leech training script, because it is also on the Dashboard.

@hitechbunny , ever thought about collecting the number of leeches from every user with the script installed and allowing us to see some statistics of it? For example, having the average of leeches from all users between lvls 21-30 would allow me to better understand how well I’m doing.

1 Like

@jprspereira I have given it some thought. Do you think it’s a okay for me to share that kind of aggregate information? So far when a script uses it’s api key I’m not sharing any of the data that it accesses.

1 Like

Good question. Personally, I wouldn’t mind at all. It would be anonymous and you would be giving us even better tools to manage our WK load. However, I’m sure there will be people not agreeing with this. If you like the idea, you could either create a new script or add an option to allow users to use this function (or not). If they choose to use it, they’d have to share their stats anonymously.

1 Like

I don’t think you should do this unless it’s opt in. And at that point most people won’t think to turn it on unless you prompt them or have a settings page.

1 Like

I moved to the stats to a separate topic: Leech Statistics.

1 Like

The script itself is neat, I just have one tiny complaint…

Could you please prompt the user before logging them in with their API key into your site?
You seem to be storing the keys in a serverside database, because after deleting cookies one is still logged in.

I do not mind personally, but simply transfering the API key without a notice is kinda shady if you ask me.

Thanks for bringing this up, @valeth. I don’t think this is at all shady. So I want to go a lot deeper into the topic than you intended, to explain why. This is partly because it has also been a topic that’s been on my mind.

The brief answer is that I feel I have everyone’s best interests at heart. I’ve written a web site that uses your api key because it makes lots of scripts possible that wouldn’t otherwise be feasible. Because of this there are a number of places an api key ends up by having a script I’ve written active. So here’s the full list:

  • In a browser cookie associated with wanikanitools-golang.curiousattemptbunny.com. You can clear cookies for that site to get rid of it, or use the sign out button on the site.
  • In an analytics tool that I use, called New Relic. Data is discarded there after two weeks (or possible one week, I forget). This is not essential, it’s just easier for me to support people when someone says the script is broken for them but it’s working for me.
  • As the index into caches of assignments, review_statistics, study_materials from the WK site. This is what makes the site so fast at computing leeches etc. This data is currently never deleted (because disk space isn’t a problem). I could either put the effort in to making them expire, or into converting the api key a one-way hash.
  • In my web server logs. This is pretty ephemeral although I’m not sure how quickly the logs are deleted.
  • Specifically for the App Store script: I’m using the api key to track which scripts the user has installed. Again, I could put the work in to use a one-way hash here.
  • Specifically for the Leech Trainer script: I’m using the api key to track which leeches have already been trained. Again, I could put the work in to use a one-way hash here.

I’d like to frame things this way:

  • Installing any user script relies heavily on trusting the author of that script. It’s essentially running arbitrary code which could do anything that JavaScript running on a web site can do.
  • All the code I write is publicly visible - either on greasyfork, or in GitHub.
  • I’m motivated to make my own experience of learning Japanese on WaniKani the best that it can be, and it delights me that others get to benefit from my efforts too. A post like this really makes my day, and affirms that I’m on the right track.
  • I easily volunteer 5 (often more) hours of my own coding time a week on the collection of scripts that I’m writing and maintaining. I have a busy life as a parent, spouse, and employee, so these hours come from a small and precious supply. All that is to say that I’m very deliberate about which features I add. I’m always looking for what gets the best making-the-most-peoples-learning-better to my-time ratio.

So to summarize, I think it boils down to:

  • Ideally, everything is good as-is, or
  • If there are one or two requests to delete api key information, I’ll do them by hand., or
  • If there are multiple requests, I’ll be motivated to either provide an iTunes-like “Agree to Terms” warning (which I personally dislike), or more likely implement a delete-all-my-data button.

Again, thanks for bringing up the topic. I hope this doesn’t come across as me picking on you, because my intention is just to be transparent about how I’m using your api key and what my motivations are.

Cheers,
hitechbunny

5 Likes

Sorry, I didn’t want it to come of as harsh as it probably did.

I’m not against storing the keys or user data per se.
Just a bit concerned if this is covered by WK’s TOS about using an user’s API key and especially user data.

I heard that they will clarify soon what can and can’t be done with the data retrieved through the API (probably when APIv2 is more stable).

1 Like

I’m getting slightly annoyed here.

I completely disabled (and even uninstalled) your userscript, cleared my caches/storage/cookies, but the leech indicator is still showing up.

Any idea why this is happening?

Screenshot with the indicators still showing up after disabling the script:
Screenshot_20171219_233047

Btw: The Appstore menu option seems to refuse to vanish as well (script is also disabled and uninstalled).

Edit:
I also explicitly logged out with the logout button on your site.

I don’t know anything about this particular script, but did you originally install it without a script manager (e.g. TamperMonkey) installed? If so, you may have a copy installed directly in the browser extensions.

I installed via Tampermonkey for Firefox.

If I disable Tampermonkey completely, the indicators are gone until I turn it on again.


Even if I delete the node in the inspector, it gets inserted again when reloading the page.


Alright, reinstalled Tampermonkey completely now with every script I was using.
It seems to be fixed now… for now at least.

1 Like

Is this script working properly for people currently or are we still having issues?

My issue is my apprentice count is off, but guru appears to be correct.

image

I quickly scrolled through the thread so maybe I missed discussion regarding this, sorry.

Is there an update I missed?

Edit : I uninstalled and reinstalled but no change. It still appears to think I have an extra item in Apprentice lv 2.

Yes I just checked, the sum is also 1 off in my case. 176 would be correct but the details show “11/23/62/81” which would sum up to 177 instead. In my case lv 4 is slighlty off and should be 80 instead of 81.

Not that I would care (or would have noticed) because it is too many damn Apprentice items either way but yeah, seems to be a general mini bug.

It’s just odd because it used to be accurate so idk what changed.

My numbers have been frozen for ~ a week now.

Website troubles OP?

@Ryouki @irrelephant @alexlf
Hmm. I don’t see anything unusual on the server-side. What you see on your JavaScript Console when you load the dashboard page?
I’d expect to see a line like this:

v2 api_key is xxxxxxxxx

and then no errors showing up in red.

Can you direct message me what shows up? (Here’s how to get to it).

1 Like

EDIT: NVM, DMed. Not sure how sensitive the API key is.

1 Like

I can send you my API key via PM if I find out how to do that or I could tell you that it looks like this: a857**…**d62c. What is off for me is always apprentice level 4 which is one item larger that other scripts show it (currently 105 instead of 104).

So far I can say that it is not a display issue in the script but the data is already wrong in srs-level-progress-cache but that was probably obvious to you anyway.

I noticed that you are using the v2 API key. Maybe it is not an issue with your script but maybe the other scripts are using the v1 API and it is a WaniKani API issue, nothing related to your scripts? But I’m just making random guesses. => no that’s not it, I fetched the results from the API directly, they are correct.

My numbers have been frozen for ~ a week now.

I don’t have that issue. They are being updated, they are just consistently off by 1.

Let me know if I can debug something that would help. I obviously really don’t feel like doing my reviews atm. :wink:

Thanks hitechbunny! The latest fix is causing my numbers to update again.