Skip to main content

A Python 3 module for the Akismet spam comment-spam-detection web service.

Project description

pykismet
========

A Python 3 Akismet client library.

## Supported API

The Following Akismet API Calls are currently supported:
* Comment Check
* Submit Ham
* Submit Spam

## Unsupported API

The following Akismet API Calls are not yet supported:
* Key Verification

## Installation

1. Signup for Akismet and get yourself an API key at http://akismet.com/plans/

2. Install this library:

pip install pykismet

3. Make some calls to Akismet (see example below to get started)

## Example

Import and instantiate Pykismet.

from pykismet3 import Akismet
import os

a = Akismet(blog_url="http://your.blog/url",
user_agent="My Awesome Web App/0.0.1")

a.api_key="YOUR_AKISMET_API_KEY"

### Comment Check

a.check({'user_ip': os.environ['REMOTE_ADDR'],
'user_agent': os.environ['HTTP_USER_AGENT'],
'referrer': os.environ.get('HTTP_REFERER', 'unknown'),
'comment_content': 'I LIEK YOUR WEB SITE',
'comment_author': 'Comment Author',
'is_test': 1,
})

### Submit Ham

a.submit_ham({'user_ip': os.environ['REMOTE_ADDR'],
'user_agent': os.environ['HTTP_USER_AGENT'],
'referrer': os.environ.get('HTTP_REFERER', 'unknown'),
'comment_content': 'I LIEK YOUR WEB SITE',
'comment_author': 'Comment Author',
'is_test': 1,
})

### Submit Spam

a.submit_spam({'user_ip': os.environ['REMOTE_ADDR'],
'user_agent': os.environ['HTTP_USER_AGENT'],
'referrer': os.environ.get('HTTP_REFERER', 'unknown'),
'comment_content': 'I LIEK YOUR WEB SITE',
'comment_author': 'Comment Author',
'is_test': 1,
})

## Documentation

The examples above show you pretty much everything you need to know.

For a full list of supported parameters for each API call, see http://akismet.com/development/api/

The code is only ~150 lines long anyway, so just look at '''pykismet.py''' if you aren't sure about something.

## Bugs

Patches to fix bugs and implement missing features welcome! Please make a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykismet3-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pykismet3-0.1.0-py2.py3-none-any.whl (6.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pykismet3-0.1.0.tar.gz.

File metadata

  • Download URL: pykismet3-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pykismet3-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f463a0ccd0e52f4767c7780cd2842af4d9b26a5ee6d4eb592554e2e7ae3edd7
MD5 7c194b2149242a2651c7f4f467568156
BLAKE2b-256 705ac6e962c64fab41304814478e95ace1328fe5824877bde3cdbf45eee480ff

See more details on using hashes here.

File details

Details for the file pykismet3-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pykismet3-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c1064cb2d8cc41f21bee211691f333d54878b35f8c94bc3b01c29c5163f7e78f
MD5 660f6dd901f918d530e5256d20372b0e
BLAKE2b-256 e23350ea0d84568480655948e4bc5e7c650a7522c37bc4954b49df962025b6d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page