One helpful tool for limiting many types of harmful bots and crawlers is a Ruby gem or plugin called CurbIt. CurbIt adds application level rate limiting to your Rails app. I recently had the pleasure of utilizing CurbIt on the Paper Rater website to limit the number of submissions. This helps us to ensure that humans are submitting documents, but without bothering our users with a CAPTCHA.
Example usage from the CurbIt github page:
class InvitesController < ApplicationController
def invite
# invite logic...
end
rate_limit :invite, :max_calls => 2, :time_limit => 30.seconds, :wait_time => 1.minute
end

No comments:
Post a Comment