I have a site which has been overrun with spam, but also has a lot of legitimate content posted.
I'd like to run the spam auto-detection on existing forum posts and comments. I'm new to the spam module so please let me know if this is easily done. I imagine doing it via cron jobs, inspecting a little bit of content at a time and marking as spam (but not deleting).
If this has not been done already, I could write the cron hook, but please let me know what functions in the spam api to call.
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | spam.module.patch | 9.25 KB | hermann77 |
| #5 | spam_filter_url.module.patch | 9.31 KB | hermann77 |
Comments
Comment #1
Dave Cohen commentedBeginning to think I won't get any help with this.
Looking through the code, I see that just about anytime the spam module does anything, it calls drupal_goto(). For example, both spam_scan() and spam_content_update() will call drupal_goto() if they find any spam. This makes them useless for calling during a cron job.
So my suspicion is no one has managed to do what I want to do, which is to automatically scan existing content and mark probable spam as spam.
Comment #2
jeremy commentedThere is code for this in the 5.x version of the module, but sadly it was never implemented in the 6.x version. Patches are welcome, marking as a feature request.
Comment #3
Dave Cohen commentedThanks for the response. This isn't a good patch, but just the code I'm experimenting with right now. I find I could not use any functions like spam_mark_as_spam() or spam_content_is_spam() because those function lead to unsavory recursion and ultimately a drupal_goto, which as I said breaks the cron jobs.
So I put the following sort of hack in my own module (although something like it could be placed in spam.module). Seems to be working OK so far. The code has a lot of print output because I'm still debugging and tweaking.
Comment #4
chrislabeard commentedAny updates on this?
Got a site with a ton of spam on it need to clean it up.
Comment #5
hermann77 commentedHi,
patch spam.module and spam_filter_url.module and you will get a button "scan" in admin/content/spam/list
It scans only "nodes", but I'm going to do it more generic, may be in the next days.
Comment #6
gnassar commented#3 is correct. The "standalone" functions are kind of a mess and not really standalone at all, and haven't been since the D5 version.
I was actually working on refactoring and re-modularizing all this code as my One Last Project(tm) before a D7 release, so we didn't go into D7 with a mess, but that took on a life of its own. The code I have now is more a rewrite of Spam than a patch. Not sure whether to submit it as a 6.x-2.x-dev or just call it a fork and make a new module.
Comment #7
avpadernoI am closing this issue, since Drupal 6 isn't supported anymore.