[jQuery] proposal for help fighting comment spams on Trac
Comment spams are the worst to manage in Trac.
I've written two small shell scripts which enable to detect comment spams and clear them easily.
Here are these scripts :
:~$ cat ./check_comments.sh
#!/bin/bash
echo "select * from ticket_change where time in (select time from ticket_change where newvalue like '%http:%');" | ./sqlite3 trac/$1/db/trac.db
:~$ cat ./erase_bad_comments.sh
#!/bin/bash
# auteur: Gilles Vincent :
<a href="mailto:gilles.vincent@gmail.com">gilles.vincent@gmail.com</a>"
# simple comment spam cleaner v.1.0
# works on <a href="http://trac.rezo.net/trac/spip">http://trac.rezo.net/trac/spip</a>
# It's based on keywords that can be found in spams
# The keywords can be detected with the complementary script : check_comments
nbargs=$#
if [ $nbargs -lt 2 ]
then
echo "simple comment spam cleaner v.1.0"
echo " It's based on keywords that can be found in spams"
echo "(take care to choose you keywords cautiously)"
echo "parameters : $0 tracName [motCle1] [motcle2] [motcle3] ..."
echo "'tracName' is mandatory : use 'spip' or 'spip-zone' or 'test' ..."
else
for x in $*
do
if [ "$x" != "$1" ]
then
echo "delete from ticket_change where time in (select time from ticket_change where newvalue like '%$x%');" | ./sqlite3 trac/$1/db/trac.db
fi
done
fi
--------------------------
This script must be adapted to your configuration :
For spip, every projects are stored under a unique root : trac/
The first parameter indicates the directory name of this project
It's certainly possible to clear spams automatically with some keywords (Vi*gr* etc..)
Personnaly, a daily report is sent to me with crontab, and in our case ( we are not as famous as jquery ;) it's enought.
-------------------------
Hope it helps !
.Gilles
PS.: I've implemented also a simple solution to fight ticket spams. Does it interess you ?
PPS.: have you upgraded to Trac1.0 ? There is an antispam plugin which looks quite good :
<a href="http://trac.edgewall.org/wiki/SpamFilter">http://trac.edgewall.org/wiki/SpamFilter</a>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/