A few years back, Koichi from Tofugu made a wonderful exercise sheet, which consisted of… 4500 sentences in Japanese, that you had to translate. With no solution sheet. The thing is, his idea is actually - and perhaps surprisingly - deeply rooted in the science of learning. You can learn more about it here.
Here is the result: a simple tool (it fits in one small JS script) running on your device that fetches all the example sentences you’ve seen in WaniKani and generates a printable PDF.
If the script doesn’t work:
Try another browser or device, that might fix it (the script runs on your device so it’s sensitive to those things). Whether it does or not, don’t hesitate to tell me your OS version, your browser version and what went wrong, I’ll have a look into it.
Update: There were a few hiccups at the beginning, but it looks like the tool works pretty well now!
WHOA! This is amazing, I’m not sure what I was expecting but 162 pages of practice sentences generated in a second is beyond it. I can definitely see myself working on my pdf little by little for a while. Thank you for this, I look forward to generating my final sheet once I reach level 60.
I hesitated to randomize the sentences but I didn’t for people like you who want to do this exercise several times. That way when you reach level 60 - or a bit before - you can just print from the 162nd/163rd page and you’ll have just the sentences you haven’t translated before. Of course you can still do it from the beginning all over again ^^
@HA472 Thank you for the screenshots, very helpful.
My best bet is a problem related to rate-limiting which would explain things working well until trying to fetch the 1645 sentences, though I’m not 100% sure as taiyousea didn’t seem to have any problem even at level 40.
In any case, I improved the code to handle rate-limiting correctly, you can retry it now and hopefully it works! I also added better logging for errors which should avoid a lot of guesswork in the future.
And @rocktheboat this update might have fixed it for you too
The difference in the error message is simply related to me updating the script to give more detailed errors. If you try again with your other configurations - not that you need to - you should get the same error.
Basically, this NetworkError means it’s not a problem with the API, instead the script running locally in your browser tab tries to contact the WaniKani server but fails.
My best theories for what might be going wrong:
a specific ad-blocker or privacy extension blocking the requests
your firewall blocking the requests
I might have made a mistake when handling rate-limiting and the WaniKani website blocks me completely without answering
To go around all of this:
You can try the tool from your phone while connected to the mobile network with any adblocker/VPN/… deactivated
If you want you can also send me a read-only API key by email and I’ll try examining what goes wrong in the network tab of the developer tools. If everything you tried still didn’t fix it I think there’s a good chance I’ll be able to reproduce the issue here, and if I can’t I’ll simply send you the PDF back ^^
About the CORS error (“Cross-Origin Resource Sharing” error, occurs when a web page tries to access resources from a different domain without proper permissions), is there even something I can do? You might know better than I do so I welcome your thoughts, but I’m under the impression that it’s probably a problem with the client, that may be caused by an Adblocker, very restrictive privacy settings or something like that.
I made the URL request in several chunks by limiting to 500 IDs at the same time, hopefully that fixed the issue ^^ (see commit for the curious)