Comments on: Some Spam Karma Automation in Python Linux. GNU. Freedom. Thu, 15 Feb 2018 18:04:15 +0000 hourly 1 By: David Adam Sat, 10 Mar 2007 03:27:18 +0000 Use the CSV module, Luke^WAaron!

(It makes your code more readable and has the advantage of escaping commas for you.)

By: Mike Fri, 09 Mar 2007 18:04:51 +0000 good to see someone actually posting code to a blog.

By: Yoni Thu, 08 Mar 2007 19:08:51 +0000 Just minor python style points -- you use capitalized variable names, which is generally frowned on, just as it is in Java. Classes are capped, variables aren't. So NewList1 should be something like "prettyResults" or something else meaningful.

Also, you use full tabs; it's far more common to stick with four spaces (you can set your text editor to use spaces when you hit tab) unless you're maintaining all-tabbed legacy code. It makes for more consistent display across editors and platforms.

For that matter, what are you using NewList1 for, anyways? You never read the value...

not so much criticisms as style pointers; looks pretty good otherwise. Enjoy python!

By: Aaron Thu, 08 Mar 2007 13:39:23 +0000 Karl- Spam Karma 2 is the best because of the sheer amount of control that you have over your system. CAPTCHAs are good, and you may not be getting any spam through, but they aren't perfect, and when you're getting hit as heavy as I am, you need something better.

EvilDead- Cool. Thanks for the tip. And I'm aware of the strings. 🙂

By: EvilDead Thu, 08 Mar 2007 12:04:48 +0000 Oh, I forgot the strings. In Python, you may use either ' or " for string, depending on your needs. So you can write this:

text = "'%s' is ready for review." % outfile

This produces the same result as your code without the escape characters.

By: EvilDead Thu, 08 Mar 2007 12:01:52 +0000 Hi Aaron,

Just to let you know about list comprehension:

NewList2 = [i[j] for j in range(4)]

has the same effect as:

NewList2 = []
for j in range(4):

This is useful in Python, you may need it to write clearer code if you need to use Python in your job 🙂

By: Karl Lattimer Thu, 08 Mar 2007 10:14:06 +0000 Why is Spam Karma 2 the single best?

I use Protect web forms captcha, I never get any spam.


By: Aaron Thu, 08 Mar 2007 03:46:05 +0000 Jeremy- It does have that option, and I should specify it in the post. Unfortunately, it sends the report inline in the email, and the layout is not friendly. This script returns the query to a comma-separated file, from which I can view just as if I were looking at the database result itself. And, the file is not emailed, but stored on a server.

MDL- Yes. Spam Karma 2 is much better than Akismet. Akismet is good, but does not have near the options that Spam Karma 2 does. I think you'll be pleasantly surprised.

By: MDL Thu, 08 Mar 2007 03:41:54 +0000 Is Spam Karma better than Akismet?

Ever since I started using it (in place of challenge questions), my spam problem has been fairly minimal.

Granted, I don't have nearly the spam that you do...

By: Jeremy Thu, 08 Mar 2007 02:50:13 +0000 Doesn't Spam Karma 2 have a built-in spam digest plugin?