just wondering if anyone managed to get AKISMET filter trackback spam...

I want the trackback module enabled, because I love that concept, but I couldn't find any setting in Trackback or Akismet to make AKISMENT check the incoming trackbacks and flag them for spam if necessary...

any clue??? anyone?

Comments

Christoph C. Cemper’s picture

D'arcy said:

No luck here. I've disabled trackbacks because of spam.

The spam.module claims to filter trackbacks, though...

markus_petrux’s picture

I would have loved to have the time to touch the akismet module to also deal with trackbacks, though I'm very busy IRL these days...

As I see it, when I tried to look at the spam and trackback modules is that we both are dealing with our own spam queue. Maybe that's a problem...

On the other hand, the akismet module has some functions that could be called from other modules to perform calls to the akismet API.

Maybe it would have helped if both module authors could take a look at each other's module and try to find a reasonable approach to work with...

Doubt is the beginning, not the end of wisdom.

Christoph C. Cemper’s picture

Hi,

> the akismet module has some functions that could be called from other modules to perform calls to the akismet API.

that sounds like a "quick hack" to the trackback module would be possible...
which functions would you call inside the akismet one?

markus_petrux’s picture

The Akismet API interface is located at the end of the akismet.module script, section labelled "Akismet API implementation".

Maybe the function akismet_api_cmd_comment_check() could be called from the trackback module. It would return an integer based on constants defined on top of the same script:

define('AKISMET_API_RESULT_ERROR', -1);
define('AKISMET_API_RESULT_SUCCESS', 0);
define('AKISMET_API_RESULT_IS_SPAM', 1);
define('AKISMET_API_RESULT_IS_HAM', 2);

Then the trackback module, depending on the result of this call, could accept or reject the trackback. I can't recall now if this module has its own moderation queue...

Function akismet_api_cmd_comment_check() accepts a single argument, an array that's built with the function akismet_prepare_comment_data(), which accepts 2 argument: a string that identifies the content type (only supported types now are node and comment) and an array that contains the information related to the content (author name, email, url, ip, the content text, etc.). Maybe I could add support for the trackback module here, so this function could be used to build the array needed by akismet_api_cmd_comment_check() also for trackbacks?

Doubt is the beginning, not the end of wisdom.

Christoph C. Cemper’s picture

Hey Markus!

thanks for your insights... that's pretty cool...

The Trackback module has an approval queue, but it's broken.. you cannot bulk delete the trackbacks in there...

Also I just wonder where the "owner" of trackback is - did you talk to him at any time...

With the TB spam hassles I have I am tempted to implement required changes ASAP myself...

what do you think? with your support from the AKISMET side that should be possible, imho

--- http://www.cemper.com
--- http://weblog.cemper.com
--- http://www.marketingfan.com

dgrant’s picture

There is a fix for that problem that you refer to in the trackback module. This will fix your batch deletion problem.

Index: trackback.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/trackback/trackback.module,v
retrieving revision 1.62
diff -u -p -r1.62 trackback.module
--- trackback.module    13 Jun 2006 16:00:12 -0000      1.62
+++ trackback.module    4 Jul 2006 03:09:16 -0000
@@ -362,7 +362,7 @@ function trackback_admin_overview($type
   $spam_module_exists = module_exist('spam');

   $operations = array();
-  if (module_exist('spam')) {
+  if ($spam_module_exists) {
     $operations['spam_spam_trackback'] = t('Mark the selected trackbacks as spam');
     $operations['spam_notspam_trackback'] = t('Mark the selected trackbacks as not spam');
   }
@@ -372,12 +372,7 @@ function trackback_admin_overview($type
   else {
     $operations['spam_publish_trackback'] = t('Publish the selected trackbacks');
   }
-  if (module_exist('spam')) {
-    $operations['spam_delete_trackback'] = t('Delete the selected trackbacks (no confirmation)');
-  }
-  else {
-    $operations['trackback_delete'] = t('Delete the selected trackbacks (no confirmation)');
-  }
+  $operations['spam_delete_trackback'] = t('Delete the selected trackbacks (no confirmation)');

   if ($op = $_POST['op']) {
     $edit = $_POST['edit'];
@@ -699,7 +694,7 @@ function trackback_delete($trackback) {
     db_query("DELETE FROM {spam_tracker} WHERE id = %d AND source = 'trackback'", $trackback->trid);
     spam_log(SPAM_LOG, t('spam_delete_trackback: deleted trackback "%subject".', array('%subject' => "<em>$trackback->subject</em>")), 'trackback', $trackback->trid);
   }
-  watchdog('spam', t('Deleted trackback <em>%subject</em>.  The trackback was posted to %link.', array('%subject' => "$trackback->subject", '%link' => l(url('node/'. $trackback->nid, NULL, NULL, TRUE), url('node/'. $trackback->nid)))));
+  watchdog('trackback', t('Deleted trackback <em>%subject</em>.  The trackback was posted to %link.', array('%subject' => "$trackback->subject", '%link' => l(url('node/'. $trackback->nid, NULL, NULL, TRUE), url('node/'. $trackback->nid)))));
 }

 function trackback_admin_edit() {
@@ -758,12 +753,7 @@ function trackback_spam_admin_overview($
     $operations['spam_notspam_trackback'] = t('Mark the selected trackbacks as not spam');
   }
   $operations['spam_publish_trackback'] = t('Publish the selected trackbacks');
-  if (module_exist('spam')) {
-    $operations['spam_delete_trackback'] = t('Delete the selected trackbacks (no confirmation)');
-  }
-  else {
-    $operations['trackback_delete'] = t('Delete the selected trackbacks (no confirmation)');
-  }
+  $operations['spam_delete_trackback'] = t('Delete the selected trackbacks (no confirmation)');

   if ($op = $_POST['op']) {
     $edit = $_POST['edit'];
@@ -941,11 +931,9 @@ function spam_unpublish_trackback($trid)
 }

 function spam_delete_trackback($trid) {
-  $trackback = trackback_load($trid);
-  db_query('DELETE FROM {trackback_received} WHERE trid = %d', $trackback->trid);
-  db_query("DELETE FROM {spam_tracker} WHERE id = %d AND source = 'trackback'", $trackback->trid);
-  watchdog('spam', t('Spam: deleted trackback <em>%subject</em>.  The trackback spam was posted to %link.', array('%subject' => "$trackback->subject", '%link' => l(url('node/'. $trackback->nid, NULL, NULL, TRUE), url('node/'. $trackback->nid)))));
-  spam_log(SPAM_LOG, t('spam_delete_trackback: deleted trackback "%subject".', array('%subject' => "<em>$trackback->subject</em>")), 'trackback', $trackback->trid);
+  if ($trackback = trackback_load($trid)) {
+    trackback_delete($trackback);
+  }
 }

 function spam_notspam_trackback($trid) {
Christoph C. Cemper’s picture

Hi,

when trying to patch this I get

patching file trackback.module
patch: **** malformed patch at line 9: $spam_module_exists = module_exist('spam');

markus_petrux’s picture

If the trackback module has its own moderation queue, then things could be easier.

I didn't tried to contact the trackback module author 'cause, when I thought about it, I knew I was going to have little time. My main concern was to finish the akismet module itself.

I have recently changed my day job, and I'm now involved on a really big project that's taking almost all my time. However, I would be glad to make any changes to the akismet module, if that helps implemet a spam filter for the trackback module.

Somewhere else I posted the reasons why I have not used the Drupal repository. It was basically to help me manage support easily (by simply minitoring my own site). Though, I'm tempted to commit everything here, 'cause there might be more room for improvements that I'm not really able to achieve due to lack of time. If that happens, I'll post a notice here and at my site. ;-) For now, I believe I could do small changes to share the akismet API easily.

Doubt is the beginning, not the end of wisdom.

Christoph C. Cemper’s picture

Hey Markus,

I'm busy as hell here as well, but I really want to get that trackback spam filtering done...

My summary on your suggestions is

in akismet:

phase1
_ provide a "prepare comment for check" function for feeding akismet_api_cmd_comment_check
_ call akismet from trackback for every trackback (building the comment array with the trackback data)

phase2
_ implement submit spam / submit ham functions in Trackback.module to give back to akismet

what to do you think?

best,christoph

Christoph C. Cemper’s picture

Yep, about 3 hours ago I put my trackback/akismet plugin into production at http://www.marketingfan.com

Now I know why I had 130,000 entries in the trackback table to be moderated...
those 3 hours alone caused 3000 tracksbacks to be rejected by AKISMET !!

Looking forward to finish this and

LOOKING FOR ALPHA-TESTERS !!! (D'arcy???)

cheers,christoph

--- http://www.cemper.com
--- http://weblog.cemper.com
--- http://www.marketingfan.com

Christoph C. Cemper’s picture

MichaelVail’s picture

I was pulling my hair out deleting spam track backs and I was getting thousands a day.
Have you talked to the track back module owner, because this definitely needs to be in the next version.

Thank you for your hard work

Chill35’s picture

I think that there should be a page on how to control spam in the handbook, with proposed solutions.

For the record, there seems to be an important patch to the trackback module here to work with Akismet :

http://drupal.org/node/105619

Eaton, if you ever read this, maybe some information about this this could be added to the akismet project page :
http://drupal.org/project/akismet

Caroline

Christoph C. Cemper’s picture

Michael, I have talked to him and I already commited my changes to CVS,

http://drupal.org/project/cvs/3778

however he hasn't created a new 4.7 revision
we haven't discussed 5.0 plans yet

Christoph C. Cemper’s picture

Zorac has a 5.x patch here http://drupal.org/node/103423
but it appears he took any orphan version of trackback.module for his patch, without the akismet changes in it for his fixes