Jisho Quickfire - a running history dictionary that uses Jisho.org

I’ve shared this over at /r/Team_Japanese a couple weeks ago but I figured I should post it here too.

I made a web app that allows you to look up words (using Jisho.org). Each time you look up a word, the definition gets added to the top of the page. This will allow you to look back at the words you’ve looked up recently (without having to re-look-up words or keep a bunch of tabs open). I’ve found it helpful when I’m reading or watching let’s plays and come across some words I want to look up, it’s nice to be able to look back at what I’ve looked up when I hear those words again. I suppose you could also look back at the list of words you’ve looked up and add them all to Anki if you’re into that :p.

This is what it looks like.

You can get it here. I’m working on some other projects on my personal server at the moment, otherwise I would host it publicly, so if you want to use it, you’ll need to set it up on your computer.

To set it up, click the “Download ZIP” button on the right side of the page, extract it all to a folder. Install NodeJS (see below), go to the folder in command prompt/terminal and run the command “npm install” (if you get EPERM errors, you’ll need to do it as an administrator/root). After that’s done, run “run.bat” as an administrator if you’re using Windows, or “run.sh” if you’re using Mac or Linux as root. Then you can go to http://localhost/ in your browser to use it.

After you search for something, you can press [ and ] to go back and forth between the first four results for the last word you looked up.

Installing NodeJS: People are having issues with the latest builds, it’s best to use version 0.10.x.
https://nodejs.org/dist/v0.10.38/

If you’re using a Mac, use the .pkg link. On windows use the .msi link. If you’re on Linux, you probably know what to do :).

i’m sorry, i’m super nooby with computers, how do you go to the folder in terminal??

ShotgunLagoon said... i'm sorry, i'm super nooby with computers, how do you go to the folder in terminal??
If you're using Windows you can shift + right click while you have the folder open and click "Open command window here".

I'm not super familiar with shortcuts like that for mac, but if you're using a mac you can use the command:
cd "file path to the folder"
(with the quotes if there's any spaces in the folder path)

Oh lord. Bless you.

I didn’t have a lot of time to play around with it, but I love it so far.



You’re awesome.

cmunch said... Oh lord. Bless you.

I didn't have a lot of time to play around with it, but I love it so far.

You're awesome.
 Thanks! :D. I hope you find it helpful.
ShotgunLagoon said... i'm sorry, i'm super nooby with computers, how do you go to the folder in terminal??
 Open a terminal / windows command. Type cd, a spacebar and drag the file to terminal/windows command window.

Erase at the end, before any quote o single quote to first slash or fordward slash character. Hit enter.

-----------

Open the terminal/windows command. Open the folder containing the folder. Click on the address bar at the top. Copy it. Write cd, a spacebar. Then paste in terminal/windows command window using right click. 

Have a mnemonic.
cd = change directory

i think i kinda got to the folder in terminal and ran npm install, but i can’t figure out how to run “run.sh”
also if i open run.sh, it’s just a textedit file that says “node app.js” and when i tried just typing that into terminal, i got an error.

ShotgunLagoon said... i think i kinda got to the folder in terminal and ran npm install, but i can't figure out how to run "run.sh"
also if i open run.sh, it's just a textedit file that says "node app.js" and when i tried just typing that into terminal, i got an error.
 Do 'sudo node app.js'
sheodox said...
ShotgunLagoon said... i think i kinda got to the folder in terminal and ran npm install, but i can't figure out how to run "run.sh"
also if i open run.sh, it's just a textedit file that says "node app.js" and when i tried just typing that into terminal, i got an error.
 Do 'sudo node app.js'
 ok it kinda works, but the lookup itself isn't working. it keeps saying no results found for whatever i put in. it gave me results for 将棋, but i never typed in 将棋 so i don't know where it got that from.
OTL

EDIT: ok, it works fine if i type the word in romaji or if i type in english. however, typing in japanese isn't working. this is kinda annoying since i mostly use jisho to look up kanji/vocab i don't know already.
ShotgunLagoon said...
sheodox said...
ShotgunLagoon said... i think i kinda got to the folder in terminal and ran npm install, but i can't figure out how to run "run.sh"
also if i open run.sh, it's just a textedit file that says "node app.js" and when i tried just typing that into terminal, i got an error.
 Do 'sudo node app.js'
 ok it kinda works, but the lookup itself isn't working. it keeps saying no results found for whatever i put in. it gave me results for 将棋, but i never typed in 将棋 so i don't know where it got that from.
OTL

EDIT: ok, it works fine if i type the word in romaji or if i type in english. however, typing in japanese isn't working. this is kinda annoying since i mostly use jisho to look up kanji/vocab i don't know already.
 What are you typing in? I don't think I've seen that issue before.

Edit: I have an idea. Open up the file 'layout.jade' in the 'views' folder and add this line
meta(charset="utf-8")
Insert it right below the 'head' line, and keep it in line with the link/script/title lines.

I can confirm Shotgun’s issue: When typing in kanji characters, look-ups respond with ‘No results found for “(insert kanji)”’, but English look-ups work. I’m running Mavericks (OS X 10.9.4) with the latest Node.js (v0.12.4).

I tried your suggestion and pasted the line into layout.jade, same behavior, restarted the node server, same behavior, guessed that maybe the syntax wanted single-quotes like the other lines instead of the double-quotes from your post, same behavior, restarted the server, same behavior. Poop.

This is SUCH a neat idea. Lookups would be a breeze. :slight_smile:

celluloiddemon said... I can confirm Shotgun's issue: When typing in kanji characters, look-ups respond with 'No results found for "(insert kanji)"', but English look-ups work. I'm running Mavericks (OS X 10.9.4) with the latest Node.js (v0.12.4).

I tried your suggestion and pasted the line into layout.jade, same behavior, restarted the node server, same behavior, guessed that maybe the syntax wanted single-quotes like the other lines instead of the double-quotes from your post, same behavior, restarted the server, same behavior. Poop.

This is SUCH a neat idea. Lookups would be a breeze. :)
 Could you try changing this line (line 10 from /public/js/lookup.js)
currentQuery = $lookup.val();
try changing it to
currentQuery = encodeURIComponent($lookup.val());

Before the change, searching “犬”:
No results found for “犬”

After the change, searching “犬”:
No results found for “%E7%8A%AC”

Similar-looking gibberish for many kanji lookups.

English lookups still work.

Ok, change that line back the way it was.

http://imgur.com/a/Ms7ui
Could you follow those instructions and post the screenshot here?

My console looks a little different from your screenshots.

https://imgur.com/ifCpAKg

Edit: I changed the line back to the way it was. This is a screenshot of the page after a server reset.

Edit: All kanji lookups show the same empty preview with brackets.

Here’s one with the status and methods:

https://imgur.com/ufKBZUS

Hmm, try this. Uninstall NodeJS and install this version:
http://nodejs.org/dist/v0.10.38/node-v0.10.38.pkg

I’m wondering if it might be some incompatibility between version 0.12.x and one of the packages I’m using to scrape the jisho site. I’ve had troubles with incompatibilities with newer versions on other projects before.

Looking for the best way to uninstall it - does the top answer here look thorough enough to you?

https://stackoverflow.com/questions/9044788/how-do-i-uninstall-nodejs-installed-from-pkg-mac-os-x

sheodox said... Hmm, try this. Uninstall NodeJS and install this version:
http://nodejs.org/dist/v0.10.38/node-v0.10.38.pkg

I'm wondering if it might be some incompatibility between version 0.12.x and one of the packages I'm using to scrape the jisho site. I've had troubles with incompatibilities with newer versions on other projects before.
 I was wondering why other's were having issues, didn't think about this. I was still using the v0.10.x nodejs, and I had no problems. I am on Windows 8.1 though.