[spam-stopper] Python API
Fuzzyman
fuzzyman at voidspace.org.uk
Wed Nov 30 08:25:19 UTC 2005
Phillip Pearson wrote:
>It shouldn't be too hard to write a Python interface directly to
>akismet; the details are all in the PHP code.
>
>
>
>From the info below it looks very easy.
>Here are the functions you need to implement:
>
>- function akismet_verify_key($key)
>
> This does an HTTP post to http://rest.akismet.com/1.1/verify-key
> with arguments {'key': api_key, 'blog': blog_url}. If the key is
> valid, it will return 'valid'.
>
>- function ksd_auto_check_comment($comment)
>
> This does an HTTP post to http://rest.akismet.com/1.1/comment-check
> with the following things in the argument space:
>
> - all $_SERVER vars (these are basically the CGI environment vars -
> REMOTE_ADDR etc). Run <?phpinfo()?> in PHP to see what these are.
>
> - 'user_ip': ip address of caller
> 'user_agent': http user agent
> 'referrer': http referrer
> 'blog': blog url
>
>
>
So to check a comment, you don't *actually* need to call
akismet_verify_key ?
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
> - everything else in $comment
>
> This returns 'true' if the comment is classified as spam.
>
>- function ksd_submit_nonspam_comment
>
> This does an HTTP post to http://rest.akismet.com/1.1/submit-ham
> with arguments {'blog': blog url} plus all the columns in the
> wp_comments row for the particular comment.
>
>- function ksd_submit_spam_comment
>
> As above, but submits a comment as spam, not ham. (URL is
> http://rest.akismet.com/1.1/submit-spam).
>
>
>That's about it...
>
>Cheers,
>Phil
>
>
>On Tue, Nov 29, 2005 at 01:13:34PM +0000, Fuzzyman wrote:
>
>
>>Hello,
>>
>>I have a problem with guestbook spam and I'd like to look at Akismet as
>>a possible solution. I'm a Python programmer and happy to implement my
>>own interface to Akismet given the details.
>>
>>Guestbook : http://www.voidspace.org.uk/cgi-bin/voidspace/guestbook2.py
>>Blog entry on the problem :
>>http://www.voidspace.org.uk/python/weblog/arch_d7_2005_11_26.shtml#e144
>>
>>I've already have several solutions in place, and have just
>>investigated adding a DNS blacklist lookup. Using three or four
>>blacklists it would only stop around fifty percent of my spam. :-(
>>
>>Anyway, familiar problem. I've downloaded akismet and got myself a
>>Wordpress API key.
>>
>>It turns out that Akismet is a php script... The development pages on
>>the website point to this mailing list. :-)
>>
>>I'm happy to either implement a Python interface to the php script (?)
>>*or* a Python interface direct to the Akismet API. (And make the result
>>freely available under an open source license if you want...)
>>
>>Are you happy to give me the details to do this ?
>>
>>All the best,
>>
>>
>>Fuzzyman
>>http://www.voidsspace.org.uk/python/index.shtml
>>_______________________________________________
>>spam-stopper mailing list
>>spam-stopper at lists.automattic.com
>>http://lists.automattic.com/mailman/listinfo/spam-stopper
>>
>>
>_______________________________________________
>spam-stopper mailing list
>spam-stopper at lists.automattic.com
>http://lists.automattic.com/mailman/listinfo/spam-stopper
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.automattic.com/pipermail/spam-stopper/attachments/20051130/4bc2e2be/attachment.htm>
More information about the spam-stopper
mailing list