view bin/translatefromto @ 5967:9f67418e5043

<b_jonas> ` f=bin/w\xc3\xa4lc\xc3\xa5m\xc3\xa4; >"$f" echo $\'/bin/sh\\nwelcome | sed "s/E/\xc3\x84/g;s/O/\xc3\x85/g;s/e/\xc3\xa4/g;s/o/\xc3\xa5/g"\'; chmod a+x "$f"
author HackBot
date Thu, 10 Sep 2015 11:15:33 +0000
parents 56dcce63901b
children
line wrap: on
line source

#!/bin/bash
echo "This google api no longer exists."; exit 1
TEXT="$1"
FROM=`echo "$TEXT" | sed 's/ .*$//'`
TEXT=`echo "$TEXT" | sed 's/^[^ ]* //'`
TO=`echo "$TEXT" | sed 's/ .*$//'`
TEXT=`echo "$TEXT" | sed 's/^[^ ]* //'`
if [ "$FROM" = "auto" ] ; then FROM="" ; fi

curl -e http://codu.org/ http://ajax.googleapis.com/ajax/services/language/translate \
         --data-urlencode v=1.0 \
         --data-urlencode q="$TEXT" \
         --data-urlencode langpair="$FROM"'|'"$TO" 2> /dev/null |
         json 'data["responseData"]["translatedText"]'