Hi guys, I have a lot of problems with
http://highsol.net and today I wrote script which delete all spam messages from table notices in mysql. This is php script and is very easy .... let me show you below:
<?php
$connect = mysql_connect("localhost", "USERNAME", "PASSWORD");
if (!$connect) {
die("Could not connect to the database" . mysql_error());
}
$db = mysql_select_db("DATABASE", $connect);
if (!$db) {
die("Could not select the database" . mysql_error());
}
mysql_query("DELETE FROM notice WHERE content like '
http://YOURDOMAIN/url/%' " . "AND content like '%<a href=%' " . "AND content like '%</a%' ") or die(mysql_error());
?>
I use
content like '%<a href=%' "
content like '%</a%' "
because there is a lot of spammers who post notices every hour using some autoposting software.
In case that you want to do this one with every loading of index.php you can include it using: include 'name-of-your-file.php'; in the end of index.php
I have one bash script also, which you can use with crontab:
#!/bin/sh
pass='YOUR-PASSWORD'
mysql -uUSERNAME --password=$pass << eof
use NAME_OF_DATABASE;
delete from notice where content like '
http://YOUR_DOMAIN/url/%';
delete from notice where content like '%<a href=%';
delete from notice where content like '%goo.gl%,%goo.gl%';
delete from notice where content like '%</a%';
delete from notice where content like '%:
http://YOUR_DOMAIN/url/%';
eof
In next few weeks I will write more scripts for the f***ing spammers! :)
Comments