[Userscript] Kaniwani Anki Mode

Confirming that it works. Thanks!

Hey, I’d have a request. Could you add an option to have the script autostart with reviews? It could be switchable in the script itself.

embe said... Hey, I'd have a request. Could you add an option to have the script autostart with reviews? It could be switchable in the script itself.
 I don't know what you mean exactly. Apparently I never added a button to switch it on, so as soon as you type SPACE, 1 or 2, it gets activated. Like magic. Even I didn't realize it was that simple.

Really? I have a buttom at the bottom to toggle in on/off and unless I activate it typing hitting neither space nor 1 or 2 seems to activate it. It just types exactly space, 1 or 2.

.edit. waahh. how small… it’s the dark blue one.
.edit2. Sorry… it seems that I have mistaken the thread… I mean the WaniKani one.




Ok, that’s a different story indeed.

@embe
In case you should miss it, I made a new thread with the updated version of the WaniKani one: /t/Userscript-Wanikani-Anki-Mode-active-support/14399

I can’t get this to work, any tips?

would be nice to be able to “gift” people like him with one month sub for example

You’re absolutely sure you’re using it on Kaniwani and not Wanikani?

yeah, definitely

should work now. If it doesn’t:

  • You might be on Firefox with Greasemonkey installed. Please switch to Tampermonkey
  • You expect a button, like with WK Anki mode. There isn’t one. In this case, read the ‘How to use’ in the OP

Works! Fantastic! Many thanks.

Thank you so much!

Hello, sorry to be that person but it’s not working for me. I’m using tampermonkey on firefox.

true.

Looked into the KW code and the website has changed a lot since I published this script. It used to be easy to find the correct answer on the page itself, but now I can’t seem to find where they put it. Don’t know if we can even access it with a user script any more. Spend some time on it, but couldn’t find a solution. If you really really want Anki Mode on KW, you should ask the creators about it. Either they could build it into their website (ideally) or they could tell us how to access the correct answer to the question.

Hey Mempo, you can access the answers, the info box is visually hidden but still present.

However css class names are generated (for scoping) and are subject to be re-generated if their underlying code changes. You could get to it with tag selectors (main > div > ul etc) but I’m still re-organising the layout a bit so that would be too brittle.

I’m not crazy about adding anki mode built-in right now (other priorities to work on), I could perhaps add a few custom data-attributes or ids for you. data-anki-answer, data-anki-submit etc so you can easily select the necessary elements even if the layout/css changes though.

1 Like

Should be working now. Can you confirm?

Managed to fix it by filtering out all the “lang(ja)” and then putting the pieces together.

If that breaks in the future, I will contact you about adding a custom id. Thanks for the help!

No worries, ids would definitely be safer/easier for you - but glad it’s working :slight_smile:

How can I edit it to respond to K and L instead of 1 and 2? I’m using the irrelephant version of your script (sorry…) in WK and would like to change this script to match that. Simply changing the numbers to the letters in the script didn’t do the magic…