Comments on: Some Spam Karma Automation in Python https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/ Linux. GNU. Freedom. Wed, 13 Dec 2017 19:29:15 +0000 hourly 1 https://wordpress.org/?v=5.0-alpha-42199 By: David Adam https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37288 Sat, 10 Mar 2007 03:27:18 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37288 Use the CSV module, Luke^WAaron!

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

]]>
By: Mike https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37212 Fri, 09 Mar 2007 18:04:51 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37212 good to see someone actually posting code to a blog.

]]>
By: Yoni https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37072 Thu, 08 Mar 2007 19:08:51 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37072 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 https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37033 Thu, 08 Mar 2007 13:39:23 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37033 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 https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37015 Thu, 08 Mar 2007 12:04:48 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37015 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 https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37014 Thu, 08 Mar 2007 12:01:52 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-37014 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):
NewList2.append(i[j])

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 https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-36995 Thu, 08 Mar 2007 10:14:06 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-36995 Why is Spam Karma 2 the single best?

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

K,

]]>
By: Aaron https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-36932 Thu, 08 Mar 2007 03:46:05 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-36932 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 https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-36931 Thu, 08 Mar 2007 03:41:54 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-36931 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 https://pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-36921 Thu, 08 Mar 2007 02:50:13 +0000 http://www.pthree.org/2007/03/07/some-spam-karma-automation-in-python/#comment-36921 Doesn't Spam Karma 2 have a built-in spam digest plugin?

]]>