I made a little userscript to synchronize review cache data with a nice GUI.
You can export the data in JSON-form into clipboard or file, for example to use dropbox/onedrive/googledrive, and also read it from clipboard or file.
It allows you to import reviews without creating duplicates. But you can also overwrite everything, for example to restore a backup.
This actually works pretty well to synchronize cache across devices.
The last few days I used the script extensively.
After my wanikani session on laptop or smartphone, I download the cache to my OneDrive folder. On my desktop PC, I then upload the cache-file before or after my session there and reload the page.
The heatmap then also counts the reviews from my phone or laptop.
(I use Firefox + Tampermonkey + the website + the userscripts on my smartphone.)
I just spent a good deal of time trying to get my review_cache back after something caused my wkof.file_cache to get purged.
Fortunately, I had a browser tab open that still had the heatmap data active, so I was optimistic that itād be possible to get the cache back, and it turns out I was right.
In case it may help anyone else down the line, below, Iāll explain the steps I took that led to getting the data back.
Essentially, with that tab active, I set a breakpoint inside of function day_click(data), I then clicked a day on the heatmap and ran the following (mostly taken from the Review Cache imported script, which didnāt have a context available at that time):
let press = function(com, data) {
let last = 0
let pressed = data.reviews.map((item) => {
let map = [com ? item[0] - last : last + item[0], ...item.slice(1)]
last = com ? item[0] : last + item[0]
return map
})
return { cache_version: data.cache_version, date: data.date, reviews: pressed }
}
wkof.file_cache.save('review_cache', press(true, data))
This is super great! I used it when I spent two weeks in Sweden, so that I was able to keep my review streak, but when I copied my data back it⦠adjusted the time zones. Which meant I lost my streak, because I did my reviews in the AM Sweden time⦠which was still the previous day in my normal time zone.
I wonder if thereās a way for me to fix this? It makes me sad to lose my streak because of time zone adjustment things.
Well, atleast the data in the cache can be adjusted.
In the heatmap script, you can go to settings, reviews and manually register a review at a past time to save the streak.
You can also do this with my script with a bit more control, by changing the first number of a review.
It is a unix timestamp. A number like 1734819203126 is the amount of milliseconds after 01.01.1970 00:00 UTC.
To modify the timestamps of your existing reviews, you could export your reviews, change the timestamps of the reviews you want to modify by 10006060*hours, and then overwrite the cache with that.
There are also converter websites for dates to unix timestamps, like https://www.epochconverter.com/
But just to save the streak, you could just copy an existing review entry, change the timestamp and import it as a fake entry.
All of my data is gone for some reason. It seems thereās no way to get it back. This userscript was pretty much the reason I kept coming back every day so it sucks to see that everything is gone. I hope someone adds an auto-backup feature.
It was fun while it lasted
Edit: It seem ALL of my data is gone, including other scripts, so it isnāt this scriptās fault. Iām wondering if itās WKOF thatās broken
Does anyone have an idea if this script will be affected by the announced dashboard change from WaniKani? Or at least if the data will still be saved/continued in case it canāt be displayed for a while after the change until the script got updated?
Thatās my plan too. I have a feeling it will be lost. Anyone know how to save the data? Maybe in a spreadsheet or something? I dont want to do it manually lol
The screenshots Koichi posted seem to imply WaniKani will now have a 1st-party heatmap widget, but I donāt know whether WK currently stores review stats so as not to start the map anew.
edit: Koichi confirmed it wonāt start from zero but wonāt include extra study stats.
If I recall, the most recent version of the script stores your data locally on your machine, which was a change made some time back due to some API changes at that time. It was at that point that for people who use WK from multiple computers, the heatmap only contained the data for lessons and reviews done on that machine. At that time, there was some discussion around how to move the data from one machine to another, which would detail where the data is stored and how to get at it. I will do a quick search to see if I can find when/where that discussion took place.
Editā: Start here and then read on. There are questions about where the data is and how to access it throughout the following posts for a bit.
Wanikani is mostly server side rendered and so doesnāt have access to the browserās opinion on the userās timezone until after the heatmap is rendered. Itās probably just going to be calculated based on the timezone in your user profile settings.
Are there any plans to update Heatmap to work with the newest dashboard update from a few days ago? I desperately miss the heat map, especially now that Iām at level 60 and about to be done. I wanna see the full thing!
I havenāt been able to figure out how to do this successfully. I went in and tried editing the position from ā2ā to ā4ā as well as ā0ā to try bottom and top both, but neither seemed to do anything for me. Is there something else you modified to get it to work?