Blog spam stopper hack
-
Good morning everyone, I’m new to this forum, but I thought I’d share my quick hack to cut down on the amount of blog spam I recieve. It seems that in recent months, blog spam has become an ever increasing problem.
I’m planning on adding some more functionality to this spam stopper by creating another word press table to log offending IP addresses, and perhaps some additional functionality to put the spam word list, and tollerance level into a database as well.
any way, here’s the code.
code
// Check to see if this comment is being posted by a spamming douche bag.
$douche_list=”texas,holdem,poker,video,free,cheap,viagra,prescription”;
$douche_filter=explode(‘,’,$douche_list);
// Global douche bag filter list.
$douche_tollerance=2; // douche_tollerance is the number of matches from the douche_list that
// are allowable before the user get’s redirected to tubgirl ( or whatever site you put in douche_site
$douche_site=’https://www.tubgirl.com’;
$douche_count=0; // Start them off at zero (you gotta give them the benefit of the doubt)
// Check the key portions of the comment against everything in the douche_filter list
for($i=0;$i<sizeof($douche_filter);$i++)
{
if(eregi($douche_filter[$i],$url))
{
$douche_count++;
}
if(eregi($douche_filter[$i],$comment))
{
$douche_count++;
}
if(eregi($douche_filter[$i],$author))
{
$douche_count++;
}
}
// Check the douche count against acceptable number
if($douche_count>$douche_tollerance || $douche_count==$douche_tollerance){
header( “Location: “.$douche_site );
ob_start();
print_r($_SERVER);
$assholes=ob_get_contents();
ob_end_clean();
mail(‘j_at_jraleigh.com’,’Blog_Spammer’,$assholes);
die(‘Fuck off you lame ass douche bag.’);
}
// If we’ve made it this far, let’s post.
/code
- The topic ‘Blog spam stopper hack’ is closed to new replies.