1.0.0 • Published 2 years ago

@xrenegade100/trick-question-detection v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

About

The term dark pattern was originally coined by Harry Brignull in 2010. He defined it as:

a user interface that has been carefully crafted to trick users into doing things, such as buying insurance with their purchase or signing up for recurring bills

Very often we don't realize it, but while using websites or apps, our choices and actions are influenced by dark patterns, which are reusable design patterns that somehow cause the user to make choices he or she would not normally make.

This algorithm is used to identify instances of the dark pattern trick question within web pages.

Prerequisites

  • NodeJS v16.x

Usage

import { isTrickQuestion, getSentencesFromHtmlPage } from 'trick-question-detection';

const sentences = getSentencesFromHtmlPage('https:/www.google.com');

sentences.forEach((s) => {
  console.log('Sentence:', s + ' | Score: ' + isTrickQuestion(s));
});

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Acknowledgments

Useful resources about dark patterns: