What do you want now? (Request extensions here)

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 https://www.wanikani.com/lesson/session ), 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: https://www.greasyfork.org/en/scripts/23847-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

I figured you knew most of that, but wasn’t sure what you mean by “normal DOM”. I’m not a master of the terminology either.

In my mind, DOM is just the model, and doesn’t necessarily imply a specific representation as long as the objects are nested in the same heirarchical structure.

If you do $(html).toArray(), you get an array of all the top-level DOM elements (I think), with children that form the heirarchy. Is that not what you mean by “normal DOM”?

2 Likes

Looking at it another way:

$(’#edit_user_vacation’) is equivalent to $(document).find(’#edit_user_vacation’), because jquery is smart enough to know that if you don’t specify an object to search, then you want to search document.

2 Likes

I think a normal document might be a better way to explain it. I suppose I was expecting something that looked like what you would find in the elements tab in the debug window. So $(html) would be similar to $(document) (with document being the current page’s document)

1 Like

Makes sense. Apparently, jquery doesn’t construct a top-level ‘document’ (or even <html> or <body>) from the HTML string. I don’t know if it’s a security thing or what.

Edit: I’ll add, though, that I think the Elements tab is just an interpretation of the underlying model.

1 Like