google.translate: using download-to.

db4
John Benediktsson 2013-10-20 08:52:13 -07:00
parent 91fce8c90b
commit edc3351ca8
1 changed files with 2 additions and 3 deletions

View File

@ -53,9 +53,8 @@ ERROR: response-error response error ;
: translate-tts ( text -- file )
"http://translate.google.com/translate_tts?tl=en" >url
swap "q" set-query-param http-get*
temporary-file ".mp3" append
[ binary set-file-contents ] keep ;
swap "q" set-query-param "" ".mp3" make-unique-file
[ download-to ] keep ;
! Example:
! "dog" "en" "de" translate .