vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Mini Mods - Keyword weight based spam detector (https://vborg.vbsupport.ru/showthread.php?t=184757)

HuangA 07-07-2008 10:00 PM

Keyword weight based spam detector
 
I coded this one because I constantly had to moderate and / delete them lengthy lame cell phone ads on vBulletin.com's forums and my own forums. You know, buy iphone, ipod touch, noika blah blah blah sony ericsson blah blah blah etc. etc. etc. email us, we're legitimate business in a country you've never heard of, blah blah blah spam.

While Akismet does work on filtering them out, some times they still leak through.

I know there's two other keyword based tools that automatically adds things to moderation queue (One from SirAdrian and one from tweakmonkey), but it doesn't work too well for me, because I run an iPhone / iPod Touch site and I can't have those keywords on auto spam for simply appearing. So, here's what I did for mine...

What does this product do?
  • Adds 1 vBulletin Options setting group, with 4 settings
  • Allows you to define a list of keywords with associated score
  • Allows you to set a threshold for automatic moderation
  • Allows you to set a threshold for automatic rejection
  • Allows you to set a post count limit for posts to be scanned
  • Adds 1 plugin which gets ran at newpost_process
  • Adds 1 plugin which gets ran at editpost_update_process

How does it work?
1) You configure your keyword list, and score weight. For example, I use this list:
Code:

Nokia|0.5
iPhone|0.5
iPod Touch|0.5
Order|0.5
HTC|0.5
Samsung|0.5
Sony Ericsson|0.5
hotmail|0.5
$|0.5
usd|0.5
url|0.3
email|0.5

The list basically means each time the plugin sees "Noika", it will get a score of 0.5, $, 0.5, etc. etc. A tally of all the score is totaled, and
2) You configure your moderation score, for example, I use 50.
3) You configure your rejection score, for example, I use 100.
4) You configure your exemption post count, for example, I use 5.

When a new post is being created (this could be a thread, or a reply, doesn't matter, they both trigger newpost_process hook), the plugin will count how many times each keyword appears, and total the score. If it is higher than or equal to the moderation score, it will tuck the post into moderation queue. If it is higher than or equal to the rejection score, a standard vBulletin error message is shown to the user.

How much overhead does this add? Realistically, not much... depending on amount of keywords used, I'd say most likely under 0.05 seconds of your CPU time for each post. If you are really that worried, you can set your exemption post count to something lower, and so lesser posts are scanned. Default is 5 right now.

This have been tested on 3.7.0 Beta 5, and 3.7.2. I see no reason why it would not work on 3.6.x series, too.

Change log
0.0.0 => 0.1.0
  • Changed error message to use vBulletin error message screen instead of die()
  • Added option for omitting after certain post count (default 5)
  • Added default values to options
  • Fixed options not appearing after product import (I forgot to export them for 0.0.0)
  • Added scanning for editing post (AJAX doesn't seem to give error... I'll work on that for 0.1.1 later)

HuangA 07-08-2008 08:19 PM

<Reserving second post in thread, in case if I ever need to extend beyond the first post>

KURTZ 07-08-2008 10:20 PM

interesting Andy ... but just a question runs onto the latest vB?

youradhere4222 07-08-2008 10:25 PM

This is fantastic! I've installed all of the keyword-moderation hacks but I've been having problems with effectiveness. Is there any way you could set a post count threshold for checking keywords? Also, does this work for edited posts as well?

HuangA 07-08-2008 10:44 PM

Quote:

Originally Posted by KURTZ (Post 1570501)
interesting Andy ... but just a question runs onto the latest vB?

I see no reason why it would not work with it. Though, I don't have a test forum to install it on. I'll try to work out a test forum tonight.

Quote:

Originally Posted by youradhere4222 (Post 1570502)
This is fantastic! I've installed all of the keyword-moderation hacks but I've been having problems with effectiveness. Is there any way you could set a post count threshold for checking keywords? Also, does this work for edited posts as well?

It doesn't work for edited posts yes. So in theory they can make a post with 10 characters first, and then edit it. I am planning to add that in to a later version to stop that work around.

Q-v-n-s-Q 07-08-2008 11:21 PM

Reserving, thank you

HuangA 07-09-2008 04:26 AM

Apologies for the first person to install... If you gotten 0.0.0 instead of 0.1.0, please upgrade... it is probably best if you remove 0.0.0 and then install 0.1.0 because I changed the plugin name (for differentiation) and added the missing options (forgot to export them in first build and didn't notice it).

Aside from that, I did the post count thing so it only scans for a configurable amount of posts, and made it use error message screen instead of boring die() screen as per requested.

So in summary:
KURTZ: Yes, it works for 3.7.2 :)
youradhere4222: Yes, it works for edit now (please install 0.1.0) :)

cheat-master30 07-15-2008 10:15 AM

I think I might try this, because it might block some annoying spamming that I've seen without causing the disruption of censoring it.

youradhere4222 07-22-2008 06:55 PM

This works great!

This is somewhat of a long-shot suggestion, but in addition to having posts automatically rejected could we have users automatically banned for a pre-defined period if they hit a certain number of keywords? Also, to ensure that the ban was accurate, could a PM be sent (or even better a thread posted in a "staff forum" - like reported PM's and infractions) saying that xxx has been banned for xx days for posting the following message [ quote ] nokia, ipod, etc. [ /quote ]

Thanks!

HuangA 07-23-2008 12:29 PM

Quote:

Originally Posted by youradhere4222 (Post 1581657)
This works great!

This is somewhat of a long-shot suggestion, but in addition to having posts automatically rejected could we have users automatically banned for a pre-defined period if they hit a certain number of keywords? Also, to ensure that the ban was accurate, could a PM be sent (or even better a thread posted in a "staff forum" - like reported PM's and infractions) saying that xxx has been banned for xx days for posting the following message [ quote ] nokia, ipod, etc. [ /quote ]

Thanks!

Personally, I don't want to do that on my forum because of the possibility of false positives when I'm not around, and I could potentially ban someone who is genuinely interested in my forum before they even make their first post. But, I can see usefulness of that in some other forums, so I can certainly look into coding that some time this weekend or whenever I have time... no guarentee as to when I can push that out though.


All times are GMT. The time now is 03:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01025 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete