有没有办法混淆 Rails 3 中的数据,以便只有网络访问者(而不是屏幕抓取者)才能查看数据?
我在 Rails 3 应用程序中有一些分层数据。它允许用户快速深入了解数据集。我想通过某种基于 JS 的混淆来防止人们成功地针对该网站运行机器人。以前有人这样做过吗?
I have some hierarchical data in a 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Rails 有一个用于电子邮件地址的混淆助手实例。它可能会给你一些想法..
https ://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/url_helper.rb#L475
我想你也可以使用Flash..众所周知,这对蜘蛛来说很难理解。但总的来说,这是一个失败的提议。
http://en.wikipedia.org/wiki/Security_through_obscurity
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
我决定在这里做的是添加一些东西来检测来自特定 IP 地址的每分钟请求,然后自动将该 IP 列入黑名单(将它们重定向到“您已被列入黑名单页面并将其 IP 保存在黑名单表中)”超过了可配置的数量,我在第一晚就捕获了 GoogleBot,然后也设置了一个白名单。
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.