[TYPO3-dev] Spamfilter-Service

Peter Guhl peter.guhl at win-lux.ch
Tue Jul 15 18:10:46 CEST 2008


OK, here's a quick sample code about how to use it. Should be possible 
to be put into any PHP-Code:

<?php
        // First test: Send a http-Request to the spfgblib-API

        $request = new HttpRequest;
        
$request->__construct('http://www.chabis.ch/helpers/api/index.php',HttpRequest::METH_POST);
        
$request->addPostFields(array('userid'=>'tester','sent'=>'spamform','test'=>'TEST','text'=>'great 
site!'));
       
        //echo('<PRE>');
        //var_dump($request);
        //echo('</PRE>');

        try {
            echo $request->send()->getBody();
        } catch (HttpException $ex) {
            echo $ex;
        }
?>

That "great site!" has to be replaced by the text you want to check and 
most likely you don't want to echo the exceptions and the data but use 
it internally.

Regards
    Peter




More information about the TYPO3-dev mailing list