Skip to content
This repository

A Python library for the Mollom anti-spam service

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 API
Octocat-spinner-32 .gitignore
Octocat-spinner-32 HTTPTransport.py
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 Mollom.py
Octocat-spinner-32 README.rst
Octocat-spinner-32 Util.py
Octocat-spinner-32 __init__.py
Octocat-spinner-32 setup.py
README.rst

PyMollom

A Python library for the Mollom anti-spam service.

A PyPI package is available at PyPI_pymollom. This package still implements the old XMLRPC API. Right now, the code base is moving towards the new REST API.

XMLRPC Example:

from Mollom import MollomAPI
from Mollom import MollomFault

def content_is_spam(content):
    mollom_api = MollomAPI(
        publicKey=MOLLOM_PUBLIC_KEY,
        privateKey=MOLLOM_PRIVATE_KEY)
    if not mollom_api.verifyKey():
        raise MollomFault('Your MOLLOM credentials are invalid.')

    cc = mollom_api.checkContent(postBody=content)
    # cc['spam']: 1 for ham, 2 for spam, 3 for unsure;
    # http://mollom.com/blog/spam-vs-ham
    if cc['spam'] == 2:
        return True
    return False
Something went wrong with that request. Please try again.