实施“举报此内容”并检测垃圾邮件发送者或机器人触发的事件

发布于 2024-08-20 08:00:42 字数 591 浏览 4 评论 0 原文

我正在为网站创建一个论坛,并计划实现“报告此内容”功能。

老实说,我不确定该功能有多有用(字面意思是必要的),因为发帖需要用户帐户(由管理员创建),但该解决方案令我感兴趣。

简而言之,情况是这样的:

对于所有用户,都将具有对论坛上所有(非限制)内容的只读访问权限。对于身份不明的用户,将会有一个回复按钮并报告此内容按钮。前者将继续要求登录,而我原计划后者不需要登录,这样任何人都可以标记可疑或令人反感的内容。

因此,我面临的问题基本上是“机器人点击”,或者更确切地说,如何实现系统,使其不会被“机器人点击”愚弄。

我想到了几种方法:

1)用户代理
2) 在以任何方式做出反应之前需要几个标志(在预定义的时间跨度内?)
3) 机器人.txt
4)需要在第二种形式上进行人工输入(验证码或“指定原因”)

我对它们的看法:

1)不可靠(作为唯一的解决方案)
2)这需要大量用户,可能会导致事件永远不会被触发
3)这可能是“正确”的方法,但只适用于那些尊重它的人
4) 嗯,我讨厌验证码,需要一个理由可能会提高标准太高而无法保持该功能有用

(高度开明的)社区必须与我分享哪些方法?

I'm creating a forum for a website, and plan on implementing a "Report this content" function.

In all honesty, I'm not sure how useful (lit. necessary) the feature will be, since a user account (created by admin) will be required for posting, but the solution interests me.

So in short, this is the scenario:

For all users, there will be read-only access to all (non-restricted) content on the forum. For unidentified users there will be a reply button and report this content button present. The former will proceed to require a login, while I had planned that the latter wouldn't, so that anyone would be able to flag suspicious or offensive content.

The problem I'm thus facing is basically "robot clicks", or rather how to implement the system so it won't be fooled by "robot clicks".

There are a few methods that come to mind:

1) User-agent
2) Requiring several flags (in a predefined timespan?) before reacting in any way
3) robots.txt
4) Requiring human input on a second form (captcha or "specify reason")

What I think of them:

1) Unreliable (as sole solution)
2) This requires a mass of users which might lead to the event never being triggered
3) This is probably the "right" way to go, but will only work for those who respect it
4) Meh, I hate captcha and requiring a reason might raise the bar too high to keep the function useful

What methods would the (highly enlightened) community have to share with me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

涙—继续流 2024-08-27 08:00:42

您可以使用 javascript 的 appendChild(); 将“报告此”

附加到 DOM。

这将防止大量垃圾邮件。

它还会阻止未运行 JavaScript 的用户看到报告按钮。但由于此功能不会妨碍用户体验,因此它可能是一个可以接受的选项。

window.onload = function() {
    var f = document.createElement('FORM');
        f.method = 'post';
        f.action = 'report.cgi';

    var b = document.createElement('INPUT');
        b.type = 'submit';
        b.value = 'Report this';


        f.appendChild(b);
        document.body.appendChild(f);
 }

注意:
rel="nofollow" 属性确保搜索引擎不会“计算”链接,但它们会遵循它(是的,名称暗示不同)。

如果您希望搜索引擎不触及某个文件,请使用 robots.txt

注 2:
报告某些内容是“更改”服务器上某些内容的操作。因此,它不应该是 GET 请求,而应该是 POST 请求。换句话说:不要使用 ,而是提交一个

及其 method 参数集到“发布”

You could append the 'report this' <form> to the DOM with javascript's appendChild();.

This would prevent a lot of spam.

It would also prevent users not running javascript from seeing the report button. But since this is a feature that does not hinder the user-experience, it is probably an acceptable option.

window.onload = function() {
    var f = document.createElement('FORM');
        f.method = 'post';
        f.action = 'report.cgi';

    var b = document.createElement('INPUT');
        b.type = 'submit';
        b.value = 'Report this';


        f.appendChild(b);
        document.body.appendChild(f);
 }

Note:
The rel="nofollow" attribute makes sure search engines do not 'count' the link, they do however follow it (yes, the name suggests differently).

If you want the search engines not to touch a certain file, use robots.txt

Note 2:
Reporting something is an action that 'changes' something on the server. Thus, it should not be a GET request Instead it should be a POST request. In other words: do not use a <a href""> but instead submit a <form> with its method argument set to "post".

夏有森光若流苏 2024-08-27 08:00:42

您可以简单地重定向到一个表单,用户需要在其中输入报告内容的原因。机器人可能不会在这里输入任何内容,如果用户不输入任何内容,则不会处理表单。

You could simply redirect to a form where the user needs to enter a reason for reporting the content. A robot probably would not enter anything here and the form would not be processed if the user didn't enter anything.

寻找我们的幸福 2024-08-27 08:00:42

您错过了将链接设置为 nofollow 的链接,但我会选择一种组合,需要人工输入(原因、投诉人的详细信息)来对抗机器人,并需要一些标记来阻止人们只是标记他们不同意/不同意的人就像在论坛上一样。

You missed making the link a nofollow one, but I'd opt for a combination of requiring human input (reason, details of complainant) to counter robots and requiring a number of flags to stop people just flagging people they disagree with/don't like on the forum.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文