Re: Akismet PyBlosxom Plugin

Michael Olson <mwolson-mXXj517/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
"Benj. Mako Hill" <[email protected]> writes:

> I've built a new version of the Akismet plugin that incorporates both
> my work and Blake's. As Michael Olson's has suggested, I've also
> included a command-line program that can be run locally and that can
> parse and submit spam comments to the Akismet server.
>
> Using it all is documented in a README file contained in the tarball.
>
> You can grab it here:
>   http://mako.cc/projects/pyblosxom/akismet_comments-0.2.tar.gz
>
> Feedback and improvements are welcome. I wanted to vet this here
> before I link it from my website and blog and have it added to the
> plugin registry.

One thing I notice is that akismet defines a new request data field
instead of just returning the error message.  By default,
comment-related messages get put into $comment_message, and that is a
bit more useful than having a separate field.  I've attached a patch
to fix this.


-- 
Michael Olson -- FSF Associate Member #652 -- http://www.mwolson.org/
Interests: Emacs Lisp, text markup, protocols -- Jabber: mwolson_at_hcoop.net
  /` |\ | | | Projects: Emacs, Muse, ERC, EMMS, Planner, ErBot, DVC
 |_] | \| |_| Reclaim your digital rights by eliminating DRM.
      See http://www.defectivebydesign.org/what_is_drm for details.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
pyblosxom-users mailing list
pyblosxom-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
akismet_comments-0.2.diff (text/x-patch, 885 B)
--- old/plugins/akismetcomments.py	2006-10-25 13:51:41.000000000 -0400
+++ new/plugins/akismetcomments.py	2006-10-25 17:16:55.000000000 -0400
@@ -125,13 +125,11 @@
     # false is ham, true is spam
     try:
         if api.comment_check(body, data):
-            reqdata['cmt_akismet_error'] = "Your comment looks like spam. Please try again or contact the administrator."
             print >>sys.stderr, "Rejecting comment",
-            return True
+            return (True, "Your comment looks like spam. Please try again or contact the administrator.")
         else:
             return False
     except AkismetError:
-        reqdata['cmt_akismet_error'] = "Missing essential data (e.g., a UserAgent string)."
         print >>sys.stderr, "Rejecting comment (AkismetError)",
-        return True
+        return (True, "Missing essential data (e.g., a UserAgent string).")
signature.asc (application/pgp-signature, 188 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFFP9XO+1Ho2POo0xkRAkhhAKCtIEfd8OLqL01I3bLHIRcNM46lXACgoCG7
rAYFKKNz6MiLkF3y9+GqHvQ=
=Ha8T
-----END PGP SIGNATURE-----
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.