The Wikireader application, allow user to enter different commands to read the article from Wikipedia. The information includes article content and its metadata.
Wiki Reader application current support 5 commands which are;
READ <article>- Reading certain article.ABOUT <article>- View article metadata.RANDOM- Read random article.QUIT- Quiting the application.HELP- List available commands.
This application require node and npm to run. If you do not have them you can install as sudo apt-get install nodejs which will also install npm package.
- Clone the project repository
git clone https://github.com/tebajanga/wikireader.git - Navigate to the project repository and run
npm installornpm ito install dependencies.
You need to specify the language you want to use to fetch the article by passing the language code while running the script i.e node index.js <lang_code>. For example Language code for English is en and for French is fr.
While you are in the project directory, you can start the application as;
node index.js en for English language, or
node index.js fr for Frech language.
The application will validate your language code and will present you with a prompt to enter commands.
>
The command to read article is READ <article>, you must specify or pass the article title as parameter. You can run it as;
> READ Canada
The article content will be displayed one paragraph at a time, to read the next paragraph press ENTER or RETURN key, and to quit reading the article press Q.
The command to view article metadata is ABOUT <article>, you must specify or pass the article as parameter. You can run ti as;
> ABOUT Canada
To read random article you can use RANDOM command, this command will fetch random article and will display article content one paragraph at a time, similar to READ command. You can run it as;
> RANDOM
And you will be able to viee the next paragraph by pressing ENTER or RETURN key, and Q to quit reading the article.
To list available commands of Wiki Reader application, you can use HELP command. You can run it as;
> HELP
To quit or exit the application, you can use QUIT command. You can run it as;
> QUIT
To run automated test, first navigate to the project directory and run npm test