Skip to content

Instantly share code, notes, and snippets.

@AndrewReitz
Last active August 20, 2020 13:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save AndrewReitz/3fbe0e1eff9bb787994613f6f6844160 to your computer and use it in GitHub Desktop.
Simple Script for doing quick search for language learning
#!/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