Skip to content

Instantly share code, notes, and snippets.

@izabera
Created July 25, 2014 19:03
Show Gist options
  • Save izabera/70e0f4f6d2e7b6249c5a to your computer and use it in GitHub Desktop.
Save izabera/70e0f4f6d2e7b6249c5a to your computer and use it in GitHub Desktop.
kvirc translate
%l1=$0
%l2=$1
%string=$2-
say Traduzione di \"%string\" da $b%l1$b a $b%l2$b
%string=$str.replace(%string," ","+")
%string=http://mymemory.translated.net/api/get?q=%string&langpair=%l1|%l2
http.asyncGet -e=o -w=h -i=$window (%string,$file.localdir(result))
{
%string=$file.read($file.localdir(result));
%result[]=$str.split(:\",%string);
%len=$($str.len(%result[1])-20)
%translated=$str.strip($str.left(%result[1],%len))
say -r=$3 %translated
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment