Skip to content

bstakes/grumbles.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grumbles.js

Grumbles.js is a very simple library which can be used to determine when your user is upset by listening for when they grumble (read: shout swear words). It works via the experimental SpeechRecognition api currently available in the latest version of Chrome.

Installation

NPM

npm i -S grumbles

CDN (UMD)

<script src="https://unpkg.com/grumbles@1.0.1"></script>

Usage

const stop = grumbles(({ word, context, time }) => {
  console.log(time);    // The time the grumble was grumbled.
  console.log(word);    // The word which was grumbled.
  console.log(context); // The full phrase containing the grumble.
}, 'en'); // Language is optional and defaults to 'en'
stop(); // Call this if you ever want to stop listening.

Use Cases

  • Log grumbles so you can get a metric of grumbles / minute.
  • Open a help dialog when your user grumbles.
  • Other stuff maybe.

License

MIT

About

Detect when your users are upset.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%