C# Class NSemble.Modules.Blog.Helpers.AkismetValidator

This class is responsible validating information against Akismet.
Afficher le fichier Open project: synhershko/NSemble Class Usage Examples

Protected Properties

Свойство Type Description
m_key String

Méthodes publiques

Méthode Description
AkismetValidator ( String key ) : System

Initialize class members based on the input parameters

IsSpam ( AkismetComment comment ) : System.Boolean

Check if the input comment is valid or not.

IsSpam ( string ApiKey, string domain, PostComments comment ) : bool
SubmitHam ( AkismetComment comment ) : void

This call is intended for the marking of false positives, things that were incorrectly marked as spam.

SubmitSpam ( AkismetComment comment ) : void

This call is for submitting comments that weren't marked as spam but should've been.

VerifyKey ( String domain ) : System.Boolean

Check if the validator's key is valid or not.

Méthodes protégées

Méthode Description
ExtractResult ( String content ) : System.Boolean

Check the input data for valid content: "valid" string or "true" string.

PostRequest ( String url, NameValueCollection pars ) : String

Post parameters to the input url and return the response.

PreparePars ( AkismetComment comment ) : NameValueCollection

Prepare request parameters based on the input comment.

PreparePars ( String key, String domain ) : NameValueCollection

Prepare request parameters based on the input parameters.

Method Details

AkismetValidator() public méthode

Initialize class members based on the input parameters
public AkismetValidator ( String key ) : System
key String The input Akismet key.
Résultat System

ExtractResult() protected méthode

Check the input data for valid content: "valid" string or "true" string.
protected ExtractResult ( String content ) : System.Boolean
content String The input content.
Résultat System.Boolean

IsSpam() public méthode

Check if the input comment is valid or not.
public IsSpam ( AkismetComment comment ) : System.Boolean
comment AkismetComment The input comment to be checked.
Résultat System.Boolean

IsSpam() public static méthode

public static IsSpam ( string ApiKey, string domain, PostComments comment ) : bool
ApiKey string
domain string
comment NSemble.Modules.Blog.Models.PostComments
Résultat bool

PostRequest() protected méthode

Post parameters to the input url and return the response.
protected PostRequest ( String url, NameValueCollection pars ) : String
url String The input url (absolute).
pars System.Collections.Specialized.NameValueCollection The input parameters to send.
Résultat String

PreparePars() protected méthode

Prepare request parameters based on the input comment.
protected PreparePars ( AkismetComment comment ) : NameValueCollection
comment AkismetComment The input comment.
Résultat System.Collections.Specialized.NameValueCollection

PreparePars() protected méthode

Prepare request parameters based on the input parameters.
protected PreparePars ( String key, String domain ) : NameValueCollection
key String The input key.
domain String The input domain.
Résultat System.Collections.Specialized.NameValueCollection

SubmitHam() public méthode

This call is intended for the marking of false positives, things that were incorrectly marked as spam.
public SubmitHam ( AkismetComment comment ) : void
comment AkismetComment The input comment to be sent as ham.
Résultat void

SubmitSpam() public méthode

This call is for submitting comments that weren't marked as spam but should've been.
public SubmitSpam ( AkismetComment comment ) : void
comment AkismetComment The input comment to be sent as spam.
Résultat void

VerifyKey() public méthode

Check if the validator's key is valid or not.
public VerifyKey ( String domain ) : System.Boolean
domain String
Résultat System.Boolean

Property Details

m_key protected_oe property

The Akismet key, if any.
protected String m_key
Résultat String