Detect the dark pattern trick question in web pages
·
Report Bug
·
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.
- NodeJS v16.x
import { isTrickQuestion, getSentencesFromHtmlPage } from 'trick-question-detection';
const sentences = getSentencesFromHtmlPage('https:/www.google.com');
sentences.forEach((s) => {
console.log('Sentence:', s + ' | Score: ' + isTrickQuestion(s));
});
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Useful resources about dark patterns: