This is actually really helpful, but I found a bug you may be interested in. I accidentally hit the “Generate New API Key” button, and once I did everything went back to 42+. I managed to fix it by clearing the apiKey token in the F12 developer options menu, but there really needs to be a simpler way to do this. Maybe a sanity check where it checks at the end whether the numbers have successfully changed and prompts the user for their apiKey again if they haven’t.
Also, serious question: Why is this not just a standard feature?
People having trouble with the original might be interested in trying my version of WK real numbers. I made it mostly for personal use, but it should solve some of the issues discussed here. In particular it will always either have fresh data or fall back to the 42+ if there’s an error, instead of using out-of-date cached data. (Also, it can find your API key without the popup-and-redirect flow, assuming you have generated one.)
Agreed–for a paid service it does seem like users disproportionately have to provide DIY solutions/improvements for themselves for things that should be taken care of by the people running the site. That said, I’m overall happy with what the site does provide for the price.
@Mempo The dev team recently added global variables for the real number of lessons and reviews, making API calls unnecessary. Do you want me to send you my new version of the script so you can decide if you want to incorporate it? Or if you prefer not to own the script anymore, I don’t mind uploading mine as a new script. Up to you.
Yea, please, if you have an improved version I’d greatly appreciate it if you paste it here. I’ll update the script asap.
To be honest, I don’t check in here that often any more and I probably won’t write my own patches/fixes any more. However, I know what a pain it can be to deal with abandoned scripts since I’ve adopted a few ones myself. So in the interest of the users I prefer to still ‘own’ the scripts (at the least ones with huge amounts of users like this one) so they can still get automatic updates from contributors such as yourself.
I had an issue with this script because when loaded, window.WaniKani.studyInformation was undefined. I just used a 1 second timer to fix the issue. (I am using Firefox with violentmonkey btw)
window.setTimeout(function() {
'use strict';
var $ = window.jQuery;
var wkData = window.WaniKani;
if (!wkData || !wkData.studyInformation) {
return;
}
var studyData = wkData.studyInformation.requested_information;
if (!studyData) {
return;
}
var lessonsEl = $('.lessons span');
var reviewsEl = $('.reviews span');
if (lessonsEl.length === 0 || reviewsEl.length === 0) {
return;
}
lessonsEl.text(studyData.lessons_available);
reviewsEl.text(studyData.reviews_available);
}, 1000);