Magic Word / trackback plugin

shunuhs <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
Hi,

I'm using Magic Word plugin to prevent comment spam,
I like it for easy to use and very useful.

But I have a problem.

I'm using trackback plugin, too.
When I use "Magic Word" and "trackback" both plugins,
"Magic Word" plugin reject all trackback!

Then, I confirmed other comment spam plugin , "nospam" plugin.
The "nospam" plugin included the following code to not reject trackback
in cb_comment_reject().

  > comment = args['comment']
  > if comment['author'].count("Trackback") > 0:
  >  return False

Is the "Magic Word" plugin needed such a code?


Next, I have a question.

The "no spam" plugin check which comment['author'] include "Trackback" string.
If comment author field include "Trackback" in comment spam,
dose the comment spam pass through a reject filter?

I think, in trackback plugin, when cdict dictionary have the data
indicate trackback, other plugin can check which comment or trackback
data safely, such a following code.

--- trackback_org.py    2006-12-11 10:41:16.953916800 +0900
+++ trackback.py        2006-12-11 10:50:59.271248000 +0900
@@ -95,7 +95,8 @@
                       'pubDate' : str(time.time()), \
                       'link' : form['url'].value, \
                       'source' : form.getvalue('blog_name', ''), \
-                      'description' : form.getvalue('excerpt', '') }
+                      'description' : form.getvalue('excerpt', ''), \
+                      'comment_type' : 'trackback' }
             from Pyblosxom.entries.fileentry import FileEntry
             from Pyblosxom.pyblosxom import Request
             from Pyblosxom.pyblosxom import PyBlosxom

In this case, magic_word can modify the following to not reject trackback.

--- magicword_org.py    2006-12-09 11:47:30.678048000 +0900
+++ magicword.py        2006-12-11 10:54:46.628171200 +0900
@@ -89,6 +89,10 @@
     @return: True if the comment should be rejected, False otherwise
     @rtype: C{bool}
     """
+    comment = args['comment']
+    if comment.get('comment_type') == 'trackback':
+        return False
+
     request = args['request']
     form = request.getForm()
     data = request.getData()

If the above modification, for trackback, magic_word plugin, has no problem,
please apply these next release.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.