What do you want now? (Request extensions here)

Yeah I figured, that’s why I was hoping for something that will hide them.

User and fake levels
I plan to hit level 10 tomorrow. I also want to start reading simple texts. With this I want to be able to add private vocabulary to WaniKani. So I had a look at the API and pondered a litte bit.
Getting data is pretty easy. E.g.

wkUserInfo = “https://www.wanikani.com/api/user/my_API_key/user-information
def getjsonbolus(wkUserInfo ):
response = urllib.request.urlopen(url)
data = response.read()
return json.loads(data.decode(‘utf8’))

So I think the following plan could work:

  • Put vocab data in your browsers local storage and give them e.g. a level 100.
  • The reorder ultimate script is already messing around with the review list. So it should be possible to get local vocab if available.
  • When you got an answer (Right or wrong) you have to check if the level is 100 and record it in the local storage instead of sending it to wanikani.com.
  • Also you could put regular entries in your local storage where you e.g. want to fake the progress level.
  • Anyways. Any idea what the timestamp numbers in the API data mean? Seconds since 1970?

So that’s my plot in a nutshell. Before going into more detail I would like to know whether there are some glaring plot holes! :slight_smile:

1 Like

If you want your script to last for a while, you should use API v2. (Search the forums for into). The URL you listed above is v1.

The timestamps in APIv1 are seconds since 1970. APIv2 uses ISO date strings.

I feel like this probably already exists … but I couldn’t find it … which might mean that it’s actually impossible …

I’d like a script to add to the home page a display of how many reviews (and lessons) I have done so far today. If I was in the 0/0 club I wouldn’t need it, but I’m trying to slowly make progress towards joining that club, and it would be useful for that.

1 Like

I created a topic about this a few days ago, but perhaps this would be a better place to post this request:

I would love a script that will add a heatmap of past reviews day by day? I mean something like you find on the stats page of Bunpro or like this extension for Anki:

I’ve found this type of heatmap tool to add another layer of fun motivation to doing daily reviews.

Thanks for anyone who could help with this.

3 Likes

Hello fellow scripters!

Here is a little request:

When doing lessons (i.e. when the URL is WaniKani — Log in ), and a vocabulary lesson item is displayed, I’d like to see (under the Breakdown tab) all user synonyms for each kanji displayed.

What it looks like currently for me

What I want it to look like

In nitty-gritty detail: I’d like div elements (with margin-top: 0) appended to each existing kanji meaning div.pure-u-1-4, in the region of the DOM nested under the div#voc-supplement-breakdown, generated from the user_synonyms Array retrieved from the API, to result in something that looks like the left hand side of this screenshot:

Rationale

WaniKani mnemonics often only are written from the perspective of the primary English text meaning given to a kanji. But many kanji have multiple meanings in English, and often they would be easier to memorize using one of the alternative meanings. If these alternative meanings of each kanji were visible at the same time as the explanation of the vocabulary were given, then it’d be easier for users to create their own, better mnemonic or explanation.

Also, and most importantly for me, this would work well with my [Userscript] WaniKani Bulk Add Kanji User Synonyms script.

1 Like

A heatmap that shows a past reviews day by day would be really motivating IMO. I mean something like you find on the stats page of Bunpro or like this extension for Anki: review-heatmap-1

I’ve found this type of heatmap tool to add another layer of fun motivation to doing daily reviews.

Thanks to anyone who can help with this.

I made a similar post requesting this here also btw:
https://community.wanikani.com/t/review-heatmap-script/

2 Likes

You also made the same request in this thread 17 days ago…

1 Like

Sorry about that! I didn’t realize they were the same. I’ll stop spamming. :hot_face:

1 Like

This is an idea that I know at least me and these two people would appreciate if someone were able to make it. The idea is that tapping the Enter key with your pinky a lot can get pretty straining for some people, especially when you have to do it twice. There are scripts that eliminate double tapping (WaniKani Improve 2.2.2. and the Lightning Script) and some that eliminate tapping completely (like auto-commit), but the first two only get rid of the one tap, and the third gives you less control and makes it easier to cheat (even with the add-on, which I find confusing, involving percentage accuracy). Unfortunately, I personally can’t do anything to help with it because I know nothing about scripting. I wonder if just a single tap of the space bar would be better though? Since the idea is to eliminate repeated actions? If it was just one tap, it would also be nice if it was compatible with WaniKani Improve 2.2.2., but that might be pretty complicated, I wouldn’t know.

Anyways, just an idea if anyone has the ability, time, or interest to do it.

EDIT: Oh, I just realized that a single space wouldn’t work because sometimes in English a space is needed with certain words. Maybe you could work around this, but I’d imagine it would be difficult.

So the exact behaviour you want is double tap the space bar?

Might look into that.

In the meantime, I’ve got a little known script that let’s you enter your own key to submit an answer: Wanikani Little Pinky Protector

Requires the editing of the script itself. Keycodes can be found here: https://keycode.info/

This is probably going to sound really stupid, but I’d love an “easy suspend” button on the dashboard which triggers suspend reviews and resume reviews. I have bursts of incredibly busy/stressful periods with my job/life in which WK is the first thing to get dropped for a few days, at which point it starts to become difficult to catch up (as you can probably tell my me being here for a year+ and being on level 13). While I’m going to endeavour to push through this time, being able to just open the tab and click a button would definitely be helpful. :slight_smile:

You mean a button for vacation mode?

Sorry yes, that’s exactly what I mean. Brain is fried :sweat_smile:

I made a script like that for someone already… let me see if I can find it

1 Like

Found it but it’s not working anymore and I can’t fix it. @rfindley Is there a way of accessing the /settings/account page from the dashboard with a script by using the right headers? I don’t know that stuff works. Previously I just made a plain GET and fetched the vacation mode button (including the token) from there.

1 Like

@Kumirei,

Here you go:

function get_vacation_status() {
	$.ajax('/settings/account')
		.then(extract_vacation_form)
		.then(function(form){
			var active = (form.data.commit.match(/deactivate/i) != null);
			console.log('Vacation mode is '+(active?'active':'inactive'));
		});
}

function click_vacation_button() {
	$.ajax('/settings/account')
		.then(extract_vacation_form)
		.then(function(form){
			$.post(form.url, form.data);
		});
}

function extract_vacation_form(html){
	var form = $(html).find('#edit_user_vacation');
	var url = form.attr('action');
	var data = {};
	form.find('input').toArray().forEach(function(i){
		var name = $(i).attr('name');
		var value = $(i).attr('value');
		data[name] = value;
	});
	return ({url:url, data:data});
}
2 Likes

Oh, thanks! You’re always so helpful :hugs:

Question: I thought #edit_user_vacation wouldn’t be found in the response because $(html) in extract_vacation_form only returns text, link, comment, and script nodes; but apparently it’s in there somewhere? Why doesn’t it return a normal DOM?

1 Like

$.ajax() actually just returns the whole raw html as a string, which does include the #edit_user_vacation. Wrapping it in $() turns it into a jQuery-formatted object, and I think the #edit_user_vacation is a nested object under one of those top-level nodes, which $(html).find() is able to locate.

[geez… trying to type $() is a pain. Discourse treats it as a math formula, and even putting it in backticks doesn’t help]

2 Likes

Hmm. I knew that it returned it as a string and that you could parse it with jQuery and that you can search that with .find(), but for some reason I thought you would normally get a normal looking DOM after parsing. Do you get a normal DOM when the response is XML and I’m just confusing this with that? I feel like I’ve made requests before and got a normal DOM after parsing the response

Sorry if I’m using any terms in an incorrect and confusing way, I’m trying to be as clear as I can, but as you know I don’t really know enough about this stuff

1 Like