Skip to content

Instantly share code, notes, and snippets.

@cympfh
Created August 25, 2014 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cympfh/98ce69ac07459a39f090 to your computer and use it in GitHub Desktop.
Save cympfh/98ce69ac07459a39f090 to your computer and use it in GitHub Desktop.
[ $# -ne 2 ] && echo "usage: ./% en ja" && exit 1
read Q
Q=`echo $Q | sed 's/ /%20/g'`
curl -s "https://translate.google.co.jp/translate_a/single?client=t&sl=$1&tl=$2&dt=ex&dt=ld&dt=md&dt=qc&dt=rw&dt=rm&dt=ss&dt=t&dt=at&dt=sw&ie=UTF-8&oe=UTF-8&oc=1&otf=2&ssel=3&tsel=0&q=$Q" -H 'Accept-Encoding: gzip, deflate' -H 'Host: translate.google.co.jp' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Firefox/31.0' | gunzip -d | cut -d'"' -f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment