Skip to main content

A Python library for the Mollom anti-spam service

Project description

A Python library for the Mollom anti-spam service.

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

PyMollom-0.1.tar.gz (7.3 kB view hashes)

Uploaded Source

Supported by

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