On this site if you do too many clicks or post comments too fast or something like that you get redirected to the "Are you a human" screen. Does anybody know how the developers of this site did this, or how to do something similar?
-
17Hey people, this doesn't belong on Meta! This is about verifying someone is human. They are just using SO as an example– EarlzCommented Mar 4, 2010 at 15:56
-
@Earlz: That's not what the original question said, especially given the question title.– Jon SeigelCommented Mar 4, 2010 at 15:58
-
This type of feature is known as annoying.– JonHCommented Mar 4, 2010 at 15:59
-
Was about to add this on SO before it got migrated: stackoverflow.com/questions/tagged/captcha– Jon SeigelCommented Mar 4, 2010 at 16:01
-
5And how do we get this migrated back to SO? This is a programming question, but just using SO as an example as per @earlz– RobCommented Mar 4, 2010 at 16:01
-
1@Jon Seigel. I believe the OP just didn't know how to properly phrase his question. I got from it that he was wanting to know how to implement Stack Overflow's feature. Not discuss it on Meta..– EarlzCommented Mar 4, 2010 at 16:02
-
@Rob: I don't see the point... either it belongs here to find out how it was done specifically on SO, or it's a duplicate of another question.– Jon SeigelCommented Mar 4, 2010 at 16:02
-
2@Jon, I guess we'll have to agree to disagree then, as I just plain think it's a valid question for SO. Would it be "migrated to experts-exchange" if someone asked a question along the lines of "how do I design a Question & Answer website for programmers that's extraordinarily frustrating to use, in the same way as experts-exchange?"– RobCommented Mar 4, 2010 at 16:04
-
@Rob ahhhmmm you used the hyphen word :) (what, you don't like finding your question on google and having to pay to subscribe so you can see the answer? )– EarlzCommented Mar 4, 2010 at 16:06
-
@Rob I will try to ask it again on SO– OmuCommented Mar 4, 2010 at 16:06
-
1@Jon Seigel if you meant the Captcha than I wasn't interested about that, I wanted to know how to know when some users do to many requests, acts like robot, stuff like that– OmuCommented Mar 4, 2010 at 16:10
-
3@Omu, please don't repost. This should be migrated back to SO– Nathan KoopCommented Mar 4, 2010 at 16:11
-
1@Nathan Koop is it possible to migrate it back ?– OmuCommented Mar 4, 2010 at 16:13
-
2@Omu, I've flagged it for moderator attention.. I don't believe there is a "belongs on stackoverflow" close reason on Meta though, so it will require a mod.– EarlzCommented Mar 4, 2010 at 16:16
-
2I've reopened the question, and made it less about Stack Overflow in particular - stackoverflow.com/questions/2380636/…– Sampson ModCommented Mar 4, 2010 at 16:43
4 Answers
Now all this question needs is to be moved back to stackoverflow!
It's almost certainly a heuristic that tries to "guess" that a user is some form of automated process, rather than a person, for example:
- More than "x" requests to do the same thing in a row
- More than "x" actions in a "y" period of time
Ordinarily the "x" and "y" values would be formulated to be ones that it would be unlikely for a "real person" to do, like:
- Editing the same answer 5 times in a row
- Downvoting 10 questions within 1 minute
Once you've got your set of rules, you can then implement some code that checks them at the start of each request, be it in a method that's called in Page_Load, something in your masterpage, something in the asp.net pipeline, that's the easy bit! ;)
just check how many hit / minutes you get from a specific ip or session or whatever and decide what are your preferred threshold and your good to go
At a guess...
Write a HTTP handler that records requests and store them in session.
When a new request comes in, check to see how many requests are stored (and expire old ones).
If the amount of requests in the past few minutes exceeds a given threshold, redirect the user.
If you're doing this in ASP.NET webforms, you could do this check on the site master page, ( or write a IHttpHandler
).
If you're using an MVC framework, you could write a base controller that does this check for every action.
With rails, you could write a before_request
filter.
With asp.net MVC, you could write a [ActionFilterAttribute]
attribute
I'd also check the user agent header of the request - if it doesn't look like a popular browser (or is empty) then throw the "are you a human?" page.