Skip to content

Instantly share code, notes, and snippets.

@morty
Created September 11, 2014 12:07
Show Gist options
  • Save morty/993ccf0e2dba2624f4dd to your computer and use it in GitHub Desktop.
Save morty/993ccf0e2dba2624f4dd to your computer and use it in GitHub Desktop.
Basic Mollom spam classification with Python
import requests
from requests_oauthlib import OAuth1
mollom_content_url = 'http://rest.mollom.com/v1/content'
publicKey = "XXX"
privateKey = "YYY"
auth = OAuth1(publicKey, privateKey)
headers = {'Accept': 'application/json;q=0.8, */*;q=0.5'}
r = requests.post(mollom_content_url, {'postBody': 'Hello World'}, auth=auth, headers=headers)
print r.json()['content']['spamClassification']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment