First and foremost, install direnv
.
# macOS
$ brew install direnv
# Debian-like
$ apt install direnv
Then :
$ direnv allow
Install npm modules :
$ npm i
You should set in your .envrc
the language configuration you're looking for.
This consists of three variables LANG
, CONJUGATION
, LANGUAGE
which will be used to build the URL used for the scrapping.
A few examples :
# French to Italian
export LANG=fr
export CONJUGATION=conjugaison
export LANGUAGE=italien
# English to French
export LANG=en
export CONJUGATION=conjugation
export LANGUAGE=french
The next step is set the verbs you want to scrap, this is done in verbs.json
at the root.
Simply put them as an array of strings in the language you're trying to learn (should be the same as LANGUAGE
),
["stare", "mangiare", "bere", "essere"]
Once everything is set up, you can start the scrapping using npm start
.
This will create a json file scrapped-verbs.json
.
If the format of the verbs is not to your liking, you can set the fields and the way you scrap them in constants.js
.