Giter VIP home page Giter VIP logo

python-antispam's Introduction

python-antispam

A Python API for antispam service cleantalk.org. Invisible protection from spam, no captches, no puzzles, no animals and no math.

How API stops spam?

API uses several simple tests to stop spammers.

  • Spam bots signatures.
  • Blacklists checks by Email, IP, web-sites domain names.
  • JavaScript availability.
  • Comment submit time.
  • Relevance test for the comment.

How API works?

API sends a comment's text and several previous approved comments to the servers. Servers evaluates the relevance of the comment's text on the topic, tests on spam and finaly provides a solution - to publish or put on manual moderation of comments. If a comment is placed on manual moderation, the plugin adds to the text of a comment explaining the reason for the ban server publishing.

Requirements

  • Python 2.6 and above
  • Python 3 and above

SPAM test for text comment sample

from cleantalk import CleanTalk


ct = CleanTalk(auth_key='yourkey')
ct_result = ct.request(
                message = 'abc', # Visitor comment
                sender_ip = '196.19.250.114', # Visitor IP address
                sender_email = '[email protected]', # Visitor email
                sender_nickname = 'spam_bot', # Visitor nickname
                js_on = 1, # Is visitor has JavaScript
                submit_time = 12 # Seconds from start form filling till the form POST
        )
#Check
if ct_result['allow']:
    print('Comment allowed. Reason ' + ct_result['comment'])
else:
    print('Comment blocked. Reason ' + ct_result['comment'])

API Response description

API returns Python dictionary object, where keys:

  • allow (0|1) - allow to publish or not, in other words spam or ham
  • comment (string) - server comment for requests.
  • id (string MD5 HEX hash) - unique request idenifier.

python-antispam's People

Contributors

begezavr avatar glomberg avatar safronik avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.