Created
July 10, 2009 16:41
-
-
Save nickdunn/144607 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// comes from the Akismet extension | |
include_once(WORKSPACE . '/assets/akismet.curl.class.php'); | |
$comment = array( | |
'comment_type' => 'comment', | |
'comment_author' => $_POST['fields']['author'], | |
'comment_author_email' => $_POST['fields']['email'], | |
'comment_author_url' => $_POST['fields']['url'], // this might be optional? | |
'comment_content' => implode($_POST['fields']), | |
'permalink' => URL . $_REQUEST['page'] | |
); | |
/* | |
Sign up for an API key at Wordpress. Key is under My Profile at the top o' the page. Easy to miss! | |
http://wordpress.com/wp-login.php | |
user: ... | |
pass: ... | |
*/ | |
$akismet = new akismet("API KEY HERE", URL); | |
if(!$akismet->error) { | |
if ($akismet->is_spam($comment)) { | |
return; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment