[Userscript] WaniKani Sentences

Holy Awesome!

You officially are the leader of Sect Awesome whether it shows it that way or not!

Hello,

I’m using Firefox v27.0.1, Greasemonkey v1.15, and WaniKani Example Sentences v1.1. Unfortunately, I never see any example sentences. :frowning:

Any idea why? Is there some debug info that you help you fix it?

Thanks!

The debug console tells me that I’m getting an internal server error (500) when I send the GET request. For instance, when I try to load sentences for 下さい, I get this:

Request URL:     https://jeshuam.pythonanywhere.com/wanikani-sentences/%E4%B8%8B%E3%81%95%E3%81%84
Request Method:     GET
Status Code:     HTTP/1.1 500 INTERNAL SERVER ERROR
User-Agent:    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0
Referer:    https://www.wanikani.com/vocabulary/%E4%B8%8B%E3%81%95%E3%81%84
Origin:    https://www.wanikani.com
Host:    jeshuam.pythonanywhere.com
DNT:    1
Connection:    keep-alive
Accept-Language:    en-US,en;q=0.5
Accept-Encoding:    gzip, deflate
Accept:    /
Server:    ngx_openresty/1.4.3.6
Date:    Fri, 04 Apr 2014 20:37:28 GMT
Content-Type:    text/html
Content-Length:    291
Connection:    keep-alive

I think that having all requests go through your PythonAnywhere account is probably not ideal.

Hey Kwami,

It seems to be a problem with only 下さい. I haven’t had a chance to look at it, but I might soon.

Thank you so much!! <3 And it does seem to not work for 下さい, for some reason. Anyhow, thank you!

Something weird happens with 下さい. Probably because it’s rarely written in Kanji (I haven’t ever seen it written using Kanji). If you want a whole heap of example sentences, you can get them using https://jeshuam.pythonanywhere.com/wanikani-sentences/%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84.

it’s genious. I fell in love with this script.

Well, it worked for a while, but now it’s broken again. I just tried a few lessons and none of them had any sentences.

https://www.wanikani.com/vocabulary/%E4%BB%98%E3%81%91%E3%82%8B
https://www.wanikani.com/vocabulary/%E4%BB%A5%E5%89%8D
https://www.wanikani.com/vocabulary/%E5%AD%A6%E6%A0%A1
https://www.wanikani.com/vocabulary/%E5%90%8C%E6%99%82
https://www.wanikani.com/vocabulary/%E5%9C%B0%E7%90%86

The Edict definitions work, but not the sentences. :frowning:

There are a few reasons they don’t display:

  1. There are no sentences that contain those characters.
  2. There are heaps of sentences with those characters and it takes a long time to fetch them from the remote API.
  3. The server it’s running on is going slowly (or your internet connection is slow), which means it takes a long time to fetch from the remote API.
All of those words seem to work fine for me, though :S Maybe you progressed through lessons too fast?

Didn’t realize how much I use this script until I did some lessons on my iPad over the weekend…It’s awesome :)  ありがとう!

I hope WK adds sentence support soon



Anyone else having a problem with the script link? (http://userscripts.org/scripts/show/406158) Gonna keep trying but maybe someone can host a mirror?

Userscripts.org is down.

Calion said... Userscripts.org is down.
 This.  Got the code from some other users and it was working for a while, but now the Edict Definitions/Parts of Speech script isn't working and the Example sentences look like this:



??? Help!

pushindawood said...
Calion said... Userscripts.org is down.
 This.  Got the code from some other users and it was working for a while, but now the Edict Definitions/Parts of Speech script isn't working and the Example sentences look like this:



??? Help!

 It looks like the ↳ character wasn’t copied properly. You could probably fix it yourself (see like 319 in WaniKani Example Sentences). Or I can just find somewhere else to host it -.-.

Edit: Just uploaded it to GitHub Gist, so you should be able to install it from there.

Thank you, sir!

I have updated the userscript with some snazzy new features. They are:

  1. If you enter your API key, only sentences containing Kanji vocab you have seen on WaniKani will be displayed (this does not include kana-only vocab). Each word in the sentence will also link to the appropriate WaniKani page.
  2. You can ‘explode’ the sentence by each word to make reading a little bit easier.

Snazzy!  Thanks for this.  Even after WaniKani finally gets all of the “context sentences” up, I will still be using your script.

Updated the script to work in Firefox.

No longer works on Chrome for me. It just shows the pages bar.

Edit: Nevermind. I had to reinstall it.

Nysis said... Still no luck on my end with firefox; however, your other addon (parts of speech) is working fine.

Edit:  you posted an update as i typed this; brb...

Edit2:  It's working now.  Part of the error may have been on my end due to having NoScript blocking something associated with python on this website.

Edit3:  Confirmed.  The script associated with "pythonanywhere.com" must be enabled for the sentence addon to run in FireFox.
 
I am also using Firefox... I've installed Greasemonkey but have no idea what this part in your instructions means:

"Enter your API key (go to a page where the script is enabled, click on the Tapermonkey/Greasemonkey icon and click on JeshuaM Scripts: Change API Key to enter your API key. You API key can be found on the settings page."

When I click on the GreaseMonkey icon, it fades.
When I click on the dropdown list arrow, I don't see anything mentioning "JeshuaM Scripts:", nor do any the options it gives lead to this name.
Not sure what to do?
My apologies;  I'm not all that used to using this kind of thing.

Also, I've quoted Nysis's post because, though I am using the same browser as he, I'm not sure where to go to check  if NoScript blocking anything python related.

Aurura said...
Nysis said... Still no luck on my end with firefox; however, your other addon (parts of speech) is working fine.

Edit:  you posted an update as i typed this; brb...

Edit2:  It's working now.  Part of the error may have been on my end due to having NoScript blocking something associated with python on this website.

Edit3:  Confirmed.  The script associated with "pythonanywhere.com" must be enabled for the sentence addon to run in FireFox.
 
I am also using Firefox... I've installed Greasemonkey but have no idea what this part in your instructions means:

"Enter your API key (go to a page where the script is enabled, click on the Tapermonkey/Greasemonkey icon and click on JeshuaM Scripts: Change API Key to enter your API key. You API key can be found on the settings page."

When I click on the GreaseMonkey icon, it fades.
When I click on the dropdown list arrow, I don't see anything mentioning "JeshuaM Scripts:", nor do any the options it gives lead to this name.
Not sure what to do?
My apologies;  I'm not all that used to using this kind of thing.

Also, I've quoted Nysis's post because, though I am using the same browser as he, I'm not sure where to go to check  if NoScript blocking anything python related.

 You want to click on JeshuaM Scripts: Change API Key under the "Userscript Commands" menu in Greasemonkey. This menu will only be available if you are on a page that my script runs on (e.g. https://www.wanikani.com/vocabulary/%E5%A4%A7%E4%BA%BA). I'll update the instructions to be a bit more clear.