|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.akismet.Akismet
Akistmet Java API
Akismet API documentation.
| Field Summary | |
static java.lang.String |
COMMENT_TYPE_BLANK
|
static java.lang.String |
COMMENT_TYPE_COMMENT
|
static java.lang.String |
COMMENT_TYPE_PINGBACK
|
static java.lang.String |
COMMENT_TYPE_TRACKBACK
|
| Constructor Summary | |
Akismet(java.lang.String apiKey,
java.lang.String blog)
Construct an instance to work with the Akismet API. |
|
| Method Summary | |
protected boolean |
akismetCall(java.lang.String function,
java.lang.String ipAddress,
java.lang.String userAgent,
java.lang.String referrer,
java.lang.String permalink,
java.lang.String commentType,
java.lang.String author,
java.lang.String authorEmail,
java.lang.String authorURL,
java.lang.String commentContent,
java.util.Map other)
Generic call to Akismet |
boolean |
commentCheck(java.lang.String ipAddress,
java.lang.String userAgent,
java.lang.String referrer,
java.lang.String permalink,
java.lang.String commentType,
java.lang.String author,
java.lang.String authorEmail,
java.lang.String authorURL,
java.lang.String commentContent,
java.util.Map other)
From the API docs, This is basically the core of everything. |
int |
getHttpResult()
Return the HTTP status code of the last operation |
boolean |
isVerifiedKey()
Check to see if the API key has been verified |
void |
setProxyAuthenticationConfiguration(java.lang.String proxyUsername,
java.lang.String proxyPassword)
Sets proxy authentication information. |
void |
setProxyConfiguration(java.lang.String proxyHost,
int proxyPort)
Sets proxy configuration information. |
void |
submitHam(java.lang.String ipAddress,
java.lang.String userAgent,
java.lang.String referrer,
java.lang.String permalink,
java.lang.String commentType,
java.lang.String author,
java.lang.String authorEmail,
java.lang.String authorURL,
java.lang.String commentContent,
java.util.Map other)
From the API docs, This call is intended for the marking of false positives, things that were incorrectly marked as spam. |
void |
submitSpam(java.lang.String ipAddress,
java.lang.String userAgent,
java.lang.String referrer,
java.lang.String permalink,
java.lang.String commentType,
java.lang.String author,
java.lang.String authorEmail,
java.lang.String authorURL,
java.lang.String commentContent,
java.util.Map other)
From the API docs, This call is for submitting comments that weren't marked as spam but should have been. |
boolean |
verifyAPIKey()
Verify your API key |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String COMMENT_TYPE_BLANK
public static final java.lang.String COMMENT_TYPE_COMMENT
public static final java.lang.String COMMENT_TYPE_TRACKBACK
public static final java.lang.String COMMENT_TYPE_PINGBACK
| Constructor Detail |
public Akismet(java.lang.String apiKey,
java.lang.String blog)
Usage:
Akismet akismet = new Akismet("Your API key", "http://your.blog.com/");
System.out.println("Testing comment spam: " + akismet.commentCheck("x.y.z.w", "XXX", "", "", "", "", "", "", "VIAGRA! LOTS OF VIAGRA!", null));
You do not need to call verifyAPIKey() before using the commentCheck(String, String, String, String, String, String, String, String, String, java.util.Map),
submitSpam(String, String, String, String, String, String, String, String, String, java.util.Map), or
submitHam(String, String, String, String, String, String, String, String, String, java.util.Map) methods.
apiKey - Akismet API keyblog - Blog associated with the API key
java.lang.IllegalArgumentException - If either the API key or blog is null| Method Detail |
public int getHttpResult()
public boolean isVerifiedKey()
true if the API key has been verified, false otherwise
public void setProxyConfiguration(java.lang.String proxyHost,
int proxyPort)
proxyHost - Proxy hostproxyPort - Proxy port
public void setProxyAuthenticationConfiguration(java.lang.String proxyUsername,
java.lang.String proxyPassword)
proxyUsername - Username to access proxyproxyPassword - Password to access proxypublic boolean verifyAPIKey()
true if the API key has been verified, false otherwise
protected boolean akismetCall(java.lang.String function,
java.lang.String ipAddress,
java.lang.String userAgent,
java.lang.String referrer,
java.lang.String permalink,
java.lang.String commentType,
java.lang.String author,
java.lang.String authorEmail,
java.lang.String authorURL,
java.lang.String commentContent,
java.util.Map other)
function - Function used in constructing the URL to Akismet for the proper function to call. Either "comment-check", "submit-spam", or "submit-ham".ipAddress - IP address of the comment submitteruserAgent - User agent informationreferrer - The content of the HTTP_REFERER header should be sent herepermalink - The permanent location of the entry the comment was submitted tocommentType - May be blank, comment, trackback, pingback, or a made up value like "registration"author - Submitted name with the commentauthorEmail - Submitted email addressauthorURL - Commenter URLcommentContent - The content that was submittedother - In PHP there is an array of enviroment variables called $_SERVER which contains information about the web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet as how the submited content interacts with the server can be very telling, so please include as much information as possible.
true if the comment is identified by Akismet as spam, false otherwise
public boolean commentCheck(java.lang.String ipAddress,
java.lang.String userAgent,
java.lang.String referrer,
java.lang.String permalink,
java.lang.String commentType,
java.lang.String author,
java.lang.String authorEmail,
java.lang.String authorURL,
java.lang.String commentContent,
java.util.Map other)
ipAddress - IP address of the comment submitteruserAgent - User agent informationreferrer - The content of the HTTP_REFERER header should be sent herepermalink - The permanent location of the entry the comment was submitted tocommentType - May be blank, comment, trackback, pingback, or a made up value like "registration"author - Submitted name with the commentauthorEmail - Submitted email addressauthorURL - Commenter URLcommentContent - The content that was submittedother - In PHP there is an array of enviroment variables called $_SERVER which contains information about the web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet as how the submited content interacts with the server can be very telling, so please include as much information as possible.
true if the comment is identified by Akismet as spam, false otherwise
public void submitSpam(java.lang.String ipAddress,
java.lang.String userAgent,
java.lang.String referrer,
java.lang.String permalink,
java.lang.String commentType,
java.lang.String author,
java.lang.String authorEmail,
java.lang.String authorURL,
java.lang.String commentContent,
java.util.Map other)
ipAddress - IP address of the comment submitteruserAgent - User agent informationreferrer - The content of the HTTP_REFERER header should be sent herepermalink - The permanent location of the entry the comment was submitted tocommentType - May be blank, comment, trackback, pingback, or a made up value like "registration"author - Submitted name with the commentauthorEmail - Submitted email addressauthorURL - Commenter URLcommentContent - The content that was submittedother - In PHP there is an array of enviroment variables called $_SERVER which contains information about the web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet as how the submited content interacts with the server can be very telling, so please include as much information as possible.
true if the comment is identified by Akismet as spam, false otherwise
public void submitHam(java.lang.String ipAddress,
java.lang.String userAgent,
java.lang.String referrer,
java.lang.String permalink,
java.lang.String commentType,
java.lang.String author,
java.lang.String authorEmail,
java.lang.String authorURL,
java.lang.String commentContent,
java.util.Map other)
ipAddress - IP address of the comment submitteruserAgent - User agent informationreferrer - The content of the HTTP_REFERER header should be sent herepermalink - The permanent location of the entry the comment was submitted tocommentType - May be blank, comment, trackback, pingback, or a made up value like "registration"author - Submitted name with the commentauthorEmail - Submitted email addressauthorURL - Commenter URLcommentContent - The content that was submittedother - In PHP there is an array of enviroment variables called $_SERVER which contains information about the web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet as how the submited content interacts with the server can be very telling, so please include as much information as possible.
true if the comment is identified by Akismet as spam, false otherwise
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||