wikp-tts

1.3.1 • Public • Published

Wikipedia paragraph parser with google text to speech api.

This is a sample NPM module inspired by Learn Enough JavaScript to Be Dangerous by Michael Hartl.

This module scrapes Wikipedia pages and converts them to speech with google text-to-speech. Then it plays the audio file generated.

The module can be used as follows:

Installation

First:

$ npm install --global wikp-tts

To run the client library, you must first set up authentication by creating a service account and setting an environment variable. https://cloud.google.com/text-to-speech/docs/reference/libraries Follow directions under Setting up authentication.

Replace [PATH] with the file path of the JSON file that contains your service account key.

export GOOGLE_APPLICATION_CREDENTIALS="[PATH]"

For example:

export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json"

Usage

$ wikp <URL-ARGUMENT> 

For example:

$ wikp Naruto_Uzumaki
$ wikp "Naruto Uzumaki"

For use in project:

First:

$ npm install wikp-tts --save
const WikpTts = require("wikp-tts");
let wikp = new WikpTts();
 
// processes the command line argument *the search term to wiki
wikp.perform();
$ node index.js donald_trump

You can also pass a search term directly:

wikp.perform("donald_trump");
$ node index.js

Readme

Keywords

none

Package Sidebar

Install

npm i wikp-tts

Weekly Downloads

2

Version

1.3.1

License

ISC

Unpacked Size

98.4 kB

Total Files

12

Last publish

Collaborators

  • humphrey.js