C# 클래스 Subtext.Akismet.AkismetClient

파일 보기 프로젝트 열기: ayende/Subtext 1 사용 예제들

공개 메소드들

메소드 설명
AkismetClient ( string apiKey, Uri blogUrl ) : System

Initializes a new instance of the AkismetClient class.

AkismetClient ( string apiKey, Uri blogUrl, HttpClient httpClient ) : System

Initializes a new instance of the AkismetClient class.

This constructor takes in all the dependencies to allow for dependency injection and unit testing. Seems like overkill, but it's worth it.

BuildUserAgent ( string applicationName, string appVersion ) : string

Helper method for building a user agent string in the format preferred by Akismet.

CheckCommentForSpam ( IComment comment ) : bool

Checks the comment and returns true if it is spam, otherwise false.

SubmitHam ( IComment comment ) : void

Submits a comment to Akismet that should not have been flagged as SPAM (a false positive).

SubmitSpam ( IComment comment ) : void

Submits a comment to Akismet that should have been flagged as SPAM, but was not flagged by Akismet.

VerifyApiKey ( ) : bool

Verifies the API key. You really only need to call this once, perhaps at startup.

비공개 메소드들

메소드 설명
SetServiceUrls ( ) : void
SubmitComment ( IComment comment, Uri url ) : string

메소드 상세

AkismetClient() 공개 메소드

Initializes a new instance of the AkismetClient class.
public AkismetClient ( string apiKey, Uri blogUrl ) : System
apiKey string The Akismet API key.
blogUrl System.Uri The root url of the blog.
리턴 System

AkismetClient() 공개 메소드

Initializes a new instance of the AkismetClient class.
This constructor takes in all the dependencies to allow for dependency injection and unit testing. Seems like overkill, but it's worth it.
public AkismetClient ( string apiKey, Uri blogUrl, HttpClient httpClient ) : System
apiKey string The Akismet API key.
blogUrl System.Uri The root url of the blog.
httpClient HttpClient Client class used to make the underlying requests.
리턴 System

BuildUserAgent() 공개 정적인 메소드

Helper method for building a user agent string in the format preferred by Akismet.
public static BuildUserAgent ( string applicationName, string appVersion ) : string
applicationName string Name of the application.
appVersion string The version of the app.
리턴 string

CheckCommentForSpam() 공개 메소드

Checks the comment and returns true if it is spam, otherwise false.
public CheckCommentForSpam ( IComment comment ) : bool
comment IComment
리턴 bool

SubmitHam() 공개 메소드

Submits a comment to Akismet that should not have been flagged as SPAM (a false positive).
public SubmitHam ( IComment comment ) : void
comment IComment
리턴 void

SubmitSpam() 공개 메소드

Submits a comment to Akismet that should have been flagged as SPAM, but was not flagged by Akismet.
public SubmitSpam ( IComment comment ) : void
comment IComment
리턴 void

VerifyApiKey() 공개 메소드

Verifies the API key. You really only need to call this once, perhaps at startup.
If it cannot make a request of Akismet.
public VerifyApiKey ( ) : bool
리턴 bool