Simple Script for doing quick search for language learning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PROGNAME="$(basename "$0")" | |
usage() { | |
echo "$PROGNAME: usage: $PROGNAME name" >&2 | |
exit 1 | |
} | |
results_open() { | |
#open "https://tatoeba.org/eng/sentences/search?query=$1&from=jpn&to=eng" | |
open -a "Google Chrome" "https://tatoeba.org/eng/sentences/search?query=$1&from=jpn&to=eng&orphans=no&unapproved=no&user=&tags=&list=&has_audio=yes&trans_filter=limit&trans_to=eng&trans_link=&trans_user=&trans_orphan=&trans_unapproved=&trans_has_audio=&sort=relevance" | |
open -a "Google Chrome" "https://forvo.com/word/$1/#ja" | |
open -a "Google Chrome" "https://www.google.com/search?as_st=y&tbm=isch&hl=en&as_q=$1&as_epq=&as_oq=&as_eq=&imgsz=&imgar=&imgc=&imgcolor=&imgtype=&cr=countryJP&as_sitesearch=&safe=images&as_filetype=&as_rights=" | |
open -a "Google Chrome" "https://jisho.org/search/$1" | |
text=$1 | |
for ((i=0; i<${#text}; i++ )); do | |
open -a "Google Chrome" "http://www.kanjidamage.com/kanji/search?utf8=✓&q=${text:$i:1}" | |
done | |
} | |
if [[ "$1" ]]; then | |
results_open $1 | |
else | |
usage | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment