Locked Items Plugin?

Is there a plugin somewhere that would add a number to this list where it shows the number of locked items? I’m curious. It could just be a white box that says “Locked” to the left of apprentice, with whatever massive number is there. Alternatively, does the API provide that number?

1 Like

I don’t think there’s a script for that :slight_smile:

Total number of items on Wanikani is 8879 btw.

4 Likes

I guess something like this does something similar.

3 Likes

The API doesn’t return any of those totals explicitly, but you can go through all of the subjects and calculate the totals. Setting the HTML/CSS to add another box there might be a bit trickier, especially considering they get arranged different when the screen size gets below a certain width, but i’m sure it is do-able.

This one will show you the number of locked items per level

Sounds like an interesting idea!

1 Like

You might be able to do this with the assignments endpoint, which has a boolean unlocked filter. So the API request would look like this (in cURL form):

curl --request GET \
  --url 'http://api.wanikani.com/v2/assignments?hidden=false&unlocked=false' \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR_KEY_HERE' \
  --header 'wanikani-revision: 20170710'

And the response might look like this:

{
  "object": "collection",
  "url": "https://api.wanikani.com/v2/assignments?hidden=false&unlocked=false",
  "pages": {
    "per_page": 500,
    "next_url": null,
    "previous_url": null
  },
  "total_count": 254,
  "data_updated_at": "2018-11-16T16:21:58.796739Z",
  "data": [
       ...
    ]
}

So in my case, I have 254 locked assignments.

1 Like

Decided to give it a go. I included both locked items, as well as items in your lesson queue.

https://greasyfork.org/en/scripts/395595-wanikani-locked-count

9 Likes

Thanks for the script! I’m not sure if the locked count is correct or not, but the numbers in the popup don’t add up.

3 Likes

Oops. Seems I made an incorrect assumption about how a function in wkof worked. Should be fixed now if you update

3 Likes

Thanks! And oops, seems like I have to double my effort to achieve my goal :slight_smile: That’s good to know!

Edit: If I may have a request, please remember to update the script version so that it can be updated automatically in the future.

1 Like

I did update the version image I changed it from 0.1 to 1.0.0

2 Likes

I see, maybe it’s the Tampermonkey then :man_shrugging:

1 Like

Tampermonkey only updates so often, maybe that’s it?

1 Like

I forced it to look for updates, but it didn’t find any. Anyways, reinstalling the script did the job. Thanks!

2 Likes

Awesome addition, unfortunately there is a little css conflict when used together with “WaniKani Dashboard SRS and Leech Breakdown”:
css_misalign

2 Likes

This is very neat, thanks!

1 Like

I will look into this tomorrow or during the weekend. It’s actually a HTML issue, so I’m not sure how simple it will be to resolve.

I also noticed that the apprentice box still has the rounded edge. I’ll fix that, the locked box should have the rounded edge.

man, I wander back into the forums and you already scripted it out in a day! incredible, thanks for this. :slight_smile:

1 Like

I think the locked vertical height could be adjusted the same way I did for Master/Enlightened/Burned. Maybe I should actually make my script more generic, since I’m probably modifying those three sections directly. :thinking:

It seems like there are other conflicts from the screenshots posted though, so it might not be worth making them compatible.

The issue with that is that I would have to detect that your script is installed and then insert a span like you do. I would also have to consider in which order they are run. I’m going to see if I can play around with CSS to make it fill the space regardless. Maybe making the list a flexbox instead.