Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- to="$1"
- text="$2"
- function WGET (){
- userAgent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) "
- userAgent+="Gecko/20100101 Firefox/48.0"
- wget -U "$userAgent" "$@"
- }
- data="$( WGET -qO - \
- "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=${to}&dt=t&q=${text}" \
- | sed "s/,,,0]],,.*//g" \
- | awk -F'"' 'NR==1{print $2}'
- )"
- echo " $data "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement