Skip to content

Algorithm to detect instances of the "trick question" dark pattern within websites. Bachelor's degree project.

License

Notifications You must be signed in to change notification settings

xrenegade100/trick-question-detection

Repository files navigation


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)

About

Algorithm to detect instances of the "trick question" dark pattern within websites. Bachelor's degree project.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages