@xrenegade100/trick-question-detection
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published


trick-question-detection

Detect the dark pattern trick question in web pages

· Report Bug ·

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));
});

(⬆️ back to top)

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

(⬆️ back to top)

Acknowledgments

Useful resources about dark patterns:

(⬆️ back to top)

Readme

Keywords

none

Package Sidebar

Install

npm i @xrenegade100/trick-question-detection

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

39.7 kB

Total Files

22

Last publish

Collaborators

  • xrenegade100