Link | akismet |
Author | Jason Huck |
Category | Utility |
Version | 7.x |
License | http://opensource.org/licenses/artistic-license.php |
Posted | 27 Apr 2006 |
Updated | 28 Apr 2006 |
More by this author... |
This set of tags implements the Akismet API in Lasso. Akismet is a web service that allows you to check user-contributed content, such as comments on a blog entry, for spam. See the online documentation and example code below for usage instructions. Requires a valid WordPress API Key.
var('authtest') = akismet_auth( -key=$key, -blog=server_name); 'Auth Test: ' + $authtest + '
\n'; var('commentchecktest') = akismet_commentcheck( -key=$key, -blog=server_name, -user_ip=nslookup('www.omnipilot.com'), -user_agent=client_browser, -comment_content='viagra-test-123' ); 'Comment Check: ' + $commentchecktest + '
\n';
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
> 'valid'; return: true; else; return: false; /if; /define_tag; define_tag: 'akismet_commentcheck', -required='key', -required='blog', -required='user_ip', -required='user_agent', -optional='referrer', -optional='permalink', -optional='comment_type', -optional='comment_author', -optional='comment_author_email', -optional='comment_author_url', -optional='comment_content'; local: 'postparams' = array; iterate: params, local: 'i'; if: #i->first != '-key'; local: 'name' = #i->first; #name->(removeleading: '-'); #postparams->(insert: #name = #i->second); /if; /iterate; local: 'result' = (include_url: 'http://' + #key + '.rest.akismet.com/1.1/comment-check', -postparams = #postparams ); if: #result >> 'true'; return: true; else; return: false; /if; /define_tag; define_tag: 'akismet_submitspam', -required='key', -required='blog', -required='user_ip', -required='user_agent', -optional='referrer', -optional='permalink', -optional='comment_type', -optional='comment_author', -optional='comment_author_email', -optional='comment_author_url', -optional='comment_content'; local: 'postparams' = array; iterate: params, local: 'i'; if: #i->first != '-key'; local: 'name' = #i->first; #name->(removeleading: '-'); #postparams->(insert: #name = #i->second); /if; /iterate; local: 'result' = (include_url: 'http://' + #key + '.rest.akismet.com/1.1/submit-spam', -postparams = #postparams ); /define_tag; define_tag: 'akismet_submitham', -required='key', -required='blog', -required='user_ip', -required='user_agent', -optional='referrer', -optional='permalink', -optional='comment_type', -optional='comment_author', -optional='comment_author_email', -optional='comment_author_url', -optional='comment_content'; local: 'postparams' = array; iterate: params, local: 'i'; if: #i->first != '-key'; local: 'name' = #i->first; #name->(removeleading: '-'); #postparams->(insert: #name = #i->second); /if; /iterate; local: 'result' = (include_url: 'http://' + #key + '.rest.akismet.com/1.1/submit-ham', -postparams = #postparams ); /define_tag; //] ?>
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Minor change