GithubHelp home page GithubHelp logo

mark7651 / js-bot-detector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robyconte/js-bot-detector

0.0 0.0 0.0 11 KB

An easy way to check if users visiting your websites are bot or not.

JavaScript 80.69% HTML 19.31%

js-bot-detector's Introduction

Javascript BotDetector

An easy way to check if users visiting your websites are bots or not.

If you are selling products online or you just want to check if your visitors are real persons, you can act many strategies to do that. User-Agent can be used most of time to detect bot engine but what you can do to detect real users interacting with your pages?

This project aims to be a tool that can help you doing that checking many scenarios actually allowed over internet:

  • scroll and mouse movement (for desktop)
  • gesture and device sensors recognizement (for mobile)

How to

Download and put bot-detector.js into your project js folder. After you have to include it in your page:

<script src="js/bot-detector.js"></script>

Now you can instantiate new BotDetector class and wait for the result event.

<script type="text/javascript" language="javascript">
	var callback = function(result) {
		if (result.isBot) {
			alert("You are a fucking bot!");
		}
		else {
			alert("Welcome user!");
		}
	};
	var botDetector = new BotDetector({
		timeout: 1000,
		callback: callback
	});
</script>

Your callback method will be called when detection process is completed and will returns a property, isBot containing response to your question: is, my visitor, a bot?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.