[UserScript] WaniKani Old Header

Oh shoot, didn’t even consider the user icon. Hardcoded as mine, unintentionally. Level should update after a couple seconds if Open Framework is installed. Got an idea to not need wkof, but need to try it out.

4 Likes

Oh, this is the first script I install. :stuck_out_tongue: So I don’t have anything else.

I also have a principle of not installing scripts, so mostly just wanted to test this out. :slight_smile:

window.WaniKani.studyInformation.user_information.level
?

Didn’t think of that, but it’s a good idea.
I was planning to steal it from within the account menu, since it’s displayed in there.

Yeah, not too long ago they starting putting some pretty useful (but basic) information on window.WaniKani.

Do they have username there? If so, I should switch wkof to use that.
I haven’t been in the source code of WK for a while.

Hmm this doesn’t seem to work because the script doesn’t find jQuery on my page (?)

While that should be easy enough to fix I’m curious that I don’t see any other comments here about the script not working o.o

Thank you thank you thank you! :partying_face::partying_face:
My level is displayed correctly, but I do have a cool new Batman icon!
It works perfectly for me! :partying_face::partying_face:

Yep. Here’s the whole object so you know what’s available:

{
	"studyInformation": {
		"user_information": {
			"username": "seanblue",
			"gravatar": "6dc12697dcf00524d3a9e46e6484c7a8",
			"level": 60,
			"title": "Turtles",
			"about": "",
			"website": null,
			"twitter": null,
			"topics_count": 0,
			"posts_count": 0,
			"creation_date": 1473374904,
			"vacation_date": null
		},
		"requested_information": {
			"lessons_available": 0,
			"reviews_available": 105,
			"next_review_date": 1558628540,
			"reviews_available_next_hour": 1,
			"reviews_available_next_day": 64
		}
	}
}
2 Likes

Is it on purpose that the match is https://www.wanikani.com/ and not https://www.wanikani.com/* ?
It’s a little weird that it changes back when you go to items pages etc :thinking:
Added it to my user matches and was wondering if I broke anything :see_no_evil:
Thanks for making this c:

Thank you so much for this script :sob: I love it but right now it only works on the main page. Any way to make it work on the whole site (like the radicals/kanji/vocab pages)?

Good catch. One second.

Updated. Though I can’t test, since I’m on my phone. Might cause issues during reviews/lessons…

@Makise_Kurisu

2 Likes

Guess I’ll add an exclude for WaniKani — Log in* and WaniKani — Log in* just to be sure °-°/
Thanks again.

@viet Didn’t window.WaniKani.studyInformation used to be set on any page that showed the header bar? I think it must have, because I was using it for the Real Numbers script (to not show 42+) and I never heard a complaint saying it didn’t work outside the dashboard.

Right now it’s not set on specific kanji pages (for example), which makes it not that useful. I’d guess it’s only set on the dashboard right now. I think it would need to be available on all pages (except maybe reviews/lessons) to be useful all around. Let me know if this actually worked this way (or if I’m going crazy :laughing:).

CC @DaisukeJigen @rfindley

1 Like

Thank you! It works everywhere now.

Yeah, we used to apply the counts via javascript using window.WaniKani.studyInformation. It has been dropped in favor of adding the count server-side during rendering. So you shouldn’t be seeing it on any page. Can you point to a page that has it?

1 Like

It’s on the dashboard. It’s a shame not to include it though. It was really convenient for simpler script operations to not bother with heavy API requests.

1 Like

Lol, thank you, instant install, I don’t even mind the additional batman vibe on my dashboard. :smiley:

I was already thinking of adding a little custom style to get rid of the logo and the colors for the review and lesson buttons but this is even better.

It would be cool if the time level script would work on this one.

You mean the Level Duration script by kumirei?