[STATS] Statistics site

The new version of the site (https://www.wkstats.com:10001/) understands resets. It’s not done yet, though. I still need to finish the projections page.

1 Like

Thank you @seanblue

I tried to click a few but I cannot quite see what is selected and what is not.

However I got my All burned date to show 2214-07-26, that is closer to Scotty’s birthdate :slight_smile:

55%20PM

1 Like

Wow thank you @rfindley! That looks good :slight_smile:

May I ask you a kind favour please? I still do not understand how to save data sets from the API V2 in a local database (see my question on the API V2 Beta Documentation ). Do you have any suggestion on what I could read (documentation, examples) to familiarise myself with all that?

Thank you

Have you looked through https://docs.api.wanikani.com/?

You are already successfully retrieving info from single tables, right? From there, it’s just a matter of manipulating the data in your target programming language.

In Open Framework (wkof), I read the entire /subjects table and save it into a database table (in the browser). Then I read the entire /study_materials table and store it. Then, for each /study_materials record, I look at the subject_id field and find the corresponding id in the /subjects table and join those records in memory for use in whatever way the wkof-user needs.

Knowing more about what you’re trying to achieve would help.

1 Like

Thank you @rfindley
Yep, I’ve gone through https://docs.api.wanikani.com/

save it into a database table (in the browser)

This is the first step that I’m not able to do yet. I tried to google around but I didn’t get anywhere (I kind of don’t know what I don’t know, if it makes any sense). Do you have some examples that I could use to do that please?

I’m trying to do kind of the same thing that you described:

  1. read the /subjects table and cache it into a database table in the browser
  2. read the /study_materials table and cache it into another database table in the broser
  3. join the two tables on subject_id
  4. select a level and display a sub-set of columns from the join

Are you wanting to save to the browser, or to some other offline database?

Nevermind… I hadn’t read your whole post yet (duh!)

Is there are reason you don’t want to use Open Framework? It does all of that for you.
You can read my documentation [here]. It has plenty of examples for reading data.

The code is there, too (in Apiv2.js and ItemData.js), though it’s fairly complex since it has tons of options for filtering data.

1 Like

Oh, I didn’t know the Open Framework (I’m returning to Wanikani after a prolonged hiatus).

I’ve just glanced through your link and it seems to contain a treasure trove of goodies.

Thank you for pointing that out to me. I suppose it will take me some time to familiarise myself with it, but I’ll plough through.

Just to get you started, it sounds like you’ll need Example 1 under wkof.ItemData.get_items(), but with a slight modification to the configuration:

// Include the ItemData module, and wait for it to be ready.
wkof.include('ItemData');
wkof.ready('ItemData').then(fetch_items);

// This function is called when the ItemData module is ready to use.
function fetch_items() {
    // No 'config' parameter, so we retrieve only the Wanikani /subjects endpoint.
    wkof.ItemData.get_items('subjects,study_materials')
    .then(process_items);
}

function process_items(items) {
    // TODO: Do something with the items we retrieved.
    console.log('Retrieved ' + items.length + ' items.');
}

I simply added ‘subjects,study_materials’ to the configuration of get_items(). That makes it join those two tables for you. You end up (in process_items()) with an array of items. For each item, you’ll see the subjects fields under items[n].data, and the study_materials fields under items[n].study_materials (if there is any study material available for that specific item).

1 Like

Thank you @rfindley.
This should keep me off the streets for a while.
I’ll let you know how I get on and hopefully regale you with stories of success.

2 Likes

First of all, thanks for this amazing creation! :blush:

I have a small notice: the level 7 vocab 氏 remained greyed out, even though I’ve already learned it. Maybe the problem is that in WaniKani it is 〜氏, but wkstats says plain 氏?

3 Likes

It’s not greyed out on mine.

Or are you using the old site? If so you should probably switch over to: https://www.wkstats.com:10001

1 Like

Yes, I was using the old one, because I liked the look and design of it better. The new displays it correctly, thanks for the idea! I guess there was a change some time ago, when the WK vocab was changed from 氏 to 〜氏, but it was never updated on the old wkstats site.

4 Likes

Hi. I love this statistics site. However, I have a problem. I restarted WK from scratch because I had reached level 35 and stopped doing reviews (and studying Japanese) for a year, so, after that, I couldn’t remember anything. Now the statistics are all messed up. They won’t show the new dates, but the old ones and also the time I take in each level is messed up because as soon as I reach a new level the time I spent in the previous level appears to be the time I spent when I did the level for the first time and not the most recent one. Hope this could be fixed, if it’s not that difficult. Thanks!!!

Have you reset? And if you did, then you should use the new site https://www.wkstats.com:10001/progress/dashboard which uses API V2 which has the actual time spent on the level (if I understand that correctly).

4 Likes

The new site with API V2 works perfect!!! Thank you very much!

2 Likes

Hello there!

Firstly, thank you so much for working on the wanikani stats site. Love it!!

That said, I’m having an issue with it at the moment and am wondering if you can help me?
I recently reset my wanikani account to level one after a long period of absence. In the original wanikani stats site, it now says I’ve been on level 3 for 837 days, 8 hours. Whichever my current level is will end up with this elongated time.

It looks like this -

People have suggested using V2 in the forums, but V2 doesn’t populate any data for me.

It looks like this-

Any ideas on how to fix this?
Thank you very much in advance.

Your API key is working fine for me on V2.

It does take a moment to load the first time because it has to collect a bunch of data first… but normally you’d see a progress bar pop up after 1sec of loading.

From your screen-shots, it looks like you’re on a phone, so I don’t have much troubleshooting advice. If you can try it on a computer browser, you can press F12 and click on the Console tab to see if there are any errors in the Javascript console.

(Nice accuracy, by the way :slight_smile: )

Thank you for the super fast reply!

  Yes, I am using my mobile to access WK. As per your advice I

accessed the V2 stats page on my laptop and like you said, it
loads without issue. Yay! Except… I want to access stats on my
phone. So, I tried it with “Samsung browser” and it works!! Double
yay! I usually access the web on my phone by using “Mozilla
Firefox”. I have no idea why, but it didn’t display any progress
bar or attempt to load data, other than what you previously saw in
my screenshot. I wonder if it’s an issue with Firefox? Anyway, I’m
able to access V2 now, so that’s great. The stats in there are SO
different in regards to times on levels. I think it is tons more
accurate. Looking forward to seeing the projections up and running
in V2 soon. Appreciate all your hard work!

  (PS: Thanks for your comment about my accuracy! Hopefully I can

keep it up. I’m remembering lots more than I thought I would,
hence the reset. Clearly WK did a good job in the first place! :slight_smile:
)

1 Like

Firefox (at least on PC) has had issues with their indexedDB getting corrupted, which causes Open Framework to not work…and I use Open Framework on wkstats. If that’s also true on Firefox mobile, then maybe clearing browser cache (if that’s possible on mobile) will fix the issue.

For what it’s worth, I have a Samsung Galaxy tablet, and wkstats works fine on it in Firefox, so I don’t think it’s a general Firefox issue, but maybe just the crashed indexedDB like I mentioned.

I use Firefox on mobile when I want to run scripts, otherwise I use Dolphin. Firefox’s Javascript engine is waaaay slower than the webkit-based browsers like Chrome and Dolphin, and I stopped using Chrome because they keep making it more and more difficult – and now impossible – to put bookmarks on the New Tab page without being logged into Google, which I refuse to do).

2 Likes

By the way, when you haven’t done any vocabulary reviews, in the accuracy section, it says NaN%. Please fix this to something like --%. Thanks! :crabigator:

1 Like