Is there a way to obfuscate data in Rails 3 so that only web visitors (not screen scrapers) can view the data?
I have some hierarchical data in 开发者_如何学Ca Rails 3 applications. It allows the user to quickly drill down into the data set. I would like to prevent people from running bots successfully against this site with some sort of JS-based obfuscation. Has anyone done this before?
Rails has one instance of an obfuscation helper for use with email addresses. It might give you some ideas..
https://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/url_helper.rb#L475
I suppose you could use Flash too.. That's notoriously hard for spiders to grok. In general though this is a losing proposition.
http://en.wikipedia.org/wiki/Security_through_obscurity
What I decided to do here was to put in something that detects requests per minute from a specific IP address, then automatically blacklist that IP (redirect them to a "you've been blacklisted page and save their IP in a blacklists table) if they exceed a configurable amount. I caught the GoogleBot the first night and then set up a whitelist as well.
精彩评论