Anki is a program which makes remembering things easy. Because it's a lot more efficient than traditional study methods, you can either greatly decrease your time spent studying, or greatly increase the amount you learn.
These tools allow to use Google Translate service in command-line to translate words, and to retrieve Google Translate phrase books as a JSON list.
Translate works by generating Google token key (tk), see Token, and doesn't require to authenticate. In order to access Google translate phrase book you need to authenticate though.
Note that ankiweb.net bans ip addresses with too many (3 or 4 in an hour) authentication requests, for the reason unknown.
Perl and some modules (assume you have cpanm installed):
cpanm JSON DBI DBD::SQLite LWP::UserAgent LWP::Protocol::httpsBuild docker image (provide credentials):
GOOGLE_LOGIN=... GOOGLE_PASSWORD=... ANKI_LOGIN=... ANKI_PASSWORD=... ./build.shUse docker image:
docker run -it jamhed/anki bin/translate.pl en ru test
docker run -it jamhed/anki bin/google-phrasebook.plCreate config.json file with proper login/password:
{
"google": {
"login": "",
"password": ""
},
"anki": {
"login": "",
"password": ""
}
}Retrieve Google Translate pharse book:
bin/google-phrasebook.pl > phrasebook.jsonCopy phrases to AnkiWeb:
bin/anki-put.pl Basic phrasebook.jsonTranslate a word:
bin/tranlsate.pl en ru helpTranslate a word in raw json:
bin/tranlsate-json.pl en ru helpDump ankiweb as SQLite DB:
bin/anki-db.pl db_file_namePut a word into AnkiWeb:
bin/anki-put.pl Basic File.jsonwhere File.json is supposed to be a Google translate phrase book output.
Retrieve phrase book, translate each word and put it to AnkiWeb:
bin/anki-sync.pl Basic en-ru