[Userscript]: WaniKani Ultimate Timeline

If you’re comfortable getting into the code, you can edit line 120:

     '#timeline .grid .newday {stroke:#f22;opacity:1;}'+

Change the “#f22” to “black”:

     '#timeline .grid .newday {stroke:black;opacity:1;}'+

Seems like the initial API key fetching or whatever isn’t working now. I assume it’s because Wanikani changed the settings page.

So… it seems like WK just changed the user CP, so now this script gives me a message saying:

It seems you haven’t generated an API key yet.
Please click [here] to generate one automatically.

With the [here] link sending me to https://www.wanikani.com/account, while the correct (new) link should be https://www.wanikani.com/settings/account.

I’ve fixed it locally by replacing every occurrence of /account on the script for /settings/account, and editing line 1170 to change it from:

api_key = page.find('#api-button').parent().find('input').attr('value');

to

api_key = page.find('#user_api_key').parent().find('input').attr('value');

That about did it. Just reporting it in case other users have this issue and want to fix it themselves, and perhaps to make @rfindley 's life a bit easier :smiley:

4 Likes

Thank you, Tizzysawr. Half of my scripts were going haywire.

thank you so much!

Thanks! Looks like I have several scripts to fix now. I just noticed the change a few minutes ago while updating the stats site thread.

I thought it was all just me. I did notice the account section changed, good to know it’s a simple script change.

v6.3.3 - Updated WK account page address after site change.

2 Likes

Wow, did they tell us? Seems a bit rude to just spring a major change like that without warning.

I don’t think they said anything. I wouldn’t consider this a major change though. Functionality wise everything is still the same, I think. All that changed was the layout. Normally it wouldn’t affect the user at all. Causing some issues with userscripts was an unintended side effect.

1 Like

I was surprised to see such a big change as well. Maybe @viet can tell us more?

Just making things more organized and explicit. Plus there will be some new additional account features in the very near future (user-end account resets and account deletions).

1 Like

It has the benefit that the new layout works way better on iPad mini. Now I don’t have to turn my iPad everytime I want to access the menu. Thanks!

I’m really glad I don’t have to type in my password every time I want to change the lesson batch size :slight_smile:

wow, that’s going to be really helpful! I assume you get a lot of these requests.

I do want to say the input box for the API key looks a bit strange. There’s nothing you can manually input/change about it after all.

Yeah… Maybe it should just be text? We used to have it as a disabled input box, but I think in Firefox you can select the text to copy and paste.

If I end up changing the mark up, you all will need to update your scripts again. Heh.

Given the unusually high proliferation of userscripting on WK, it may be woth considering whether features like account reset and deletion, which are irreversable, might need an extra confirmation step that isn’t easily scriptable. Maybe generate an email with confirmation link or something.

I trust (but verify) our current script writers, but it would be easy for an unsavory wolf to mislead some sheep into installing a fork of a trusted script.

(Having done some work in security has permanently changed how I look at things…)

2 Likes

No problem… Just keep making WK better, and we’ll keep up :slight_smile:. Maybe we could have a thread for scripters to Track, where new or upcoming changes are described?

That would be best, I think. Disabled inputs can work too, but DANG why do browsers change your cursor when hovering it?!

Meh, don’t worry about that ;p

Yea, that’s probably a good idea! Maybe Viet thought of that already?

There is a confirmation input for users having to fill out. Very similar to how Github does their repo deletions

But the email idea sounds better. Will have to give it some reconsideration on how to approach it now.