Everyone knows that bots on the network, if not more, then on a par with real users so accurately. The task for the web project especially for mobile devices is to try to minimize the presence of bots.

The problem with using the user-agent is that the same developer tools successfully imitate them. There is a script implementation that reads data from the gyroscope of the device (I’ll give it below), but javascript api does not work correctly in older versions of Android ...

Are there any other options for determining the reality of the device, except for the one given by me? Interested in both client and server implementation.

 var gyroPresent = null; window.addEventListener("devicemotion", function(event) { if (event.rotationRate.alpha || event.rotationRate.beta || event.rotationRate.gamma) { gyroPresent = true; } else { gyroPresent = false; } if (gyroPresent === false) { alert('Нет гироскопа'); } }); 
  • It will be enough for gyroPresent = true; to assign gyroPresent = true; :) - Visman
  • bots usually make predictable requests. For example, a person cannot click 20-30 checkmarks in a minute. - KoVadim
  • @Visman, those encountered have not done so. you are obviously more prudent than their creators) - nueq
  • @KoVadim, this is a long-known method, ideally, do not wait for it to click, but immediately redirect it, for example, to 404 - nueq
  • @nueq, you can look in the direction of mathematical calculations on js. Give the input number / a, the output should get the correct answer :) learn.javascript.ru/… - Visman

1 answer 1

Alternatively, read screen sizes. Bots do not have a screen)) In general, 99% of bots do not handle javascript. So if js works, with high probability, we can assume that this is not a bot.

  • I think we need to return the previous version of the question. Carefully edit your question, so as not to lose data. - nick_n_a February