[Userscript] Export "known words" to clipboard

First userscript, please be gentle (I’m terrible with JS)

Export Known Words

[ Script install guide ] (Tampermonkey, Violentmonkey, etc.)
[ Download+install “Export Known Words” ]

All this does is naively copy your “known words” to your clipboard.

MaruMori is amazing, and they just added a feature to import lists of words to ignore, so here’s a quick and easy way to get that list of words from Kitsun.

Bonus

[ MaruMori scripts ]: more scripts to keep known words in sync (e.g. if you’ve mined it into kitsun). No guarantees this works anymore, it’s been a while since I’ve used it…

Bugs/feedback

If you find an issue with the script, I can’t promise I can fix it or help you debug (life is busy). If somebody wants to take over “maintenance,” I’m more than happy to link this post to your superior userscript!

Good luck <3

Known bugs

  1. It only captures (approximately) the items currently in view in the scrolling window. Fixed in v0.3
3 Likes

This is likely due to the table being a “virtual” list. Meaning it only loads and shows the data that you are currently supposed to see (while scrolling) in order to not overload the browser (in case you have thousands of cards/data for example).

I’m not sure if user-scripts can access the API, otherwise, you could also get the full data from there. You can check which call is being done in the network tab of the dev tools for your browser (and also see how the data is formatted in the result).

2 Likes

I haven’t done much UI dev, so that definitely threw me for a loop when I saw the table rows being recycled!

Thanks, that’ll probably be the easiest - I saw some data in the IndexedDB, but those just look like a card cache (which makes sense, given the “wipe cache” in settings).


It wasn’t easy to do an authenticated API call, so I just hooked XHR to read the data from the request that the webapp is already doing.


The userscript engines changed from a GM_whatever to a GM.whatever standard… GM.xmlHttpRequest uses auth cookies: javascript - ReferenceError: GM_xmlhttpRequest is not defined - Stack Overflow

2 Likes

I’m sorry, but… How to use it? =)

Once it’s installed, you can go to the known words page: https://kitsun.io/known-words

And click on “Copy to clipboard” - you should then be able to paste those words wherever you’d like.

image

1 Like

Hmm… There is no “Copy to clipboard” for me
UPD. w/e I’m blind =)

This has a bug where it will duplicate the list on the clipboard if you click on the “copy to clipboard” button twice without reloading the page. You can fix this pretty easily by making sure the string gets cleared after you send it to the clipboard.

As someone not hip on userscripts…I’m gonna try this later tonight on my computer…but quick question for the community / neicudi-- is this planned to be a native feature? I’d love to eventually be able to export my known word list native in the app!!

Thanks!

1 Like

Just bumping this to see if this is planned to be a native feature. I’ve been curating my known word list pretty extensively…and at some point I would like to be able to export this list. Whether that’s as a text file, CSV, etc.–but it would be really great to be able to compile a list of known words on my end! Especially since I pretty much exclusively use Kitsun (and WaniKani) for vocab. I used to maintain my own excel list of vocab words…and I’d very much like to be able to add to it via my Kitsun word list.

If it’s not…can I make a feature request to be able to export known words? Thanks!!

1 Like

I can likely add it relatively easily! I’ll put it on my todo list :grinning_face_with_smiling_eyes:

1 Like

You’re the best! Thanks @Neicudi :smiley: