The Artima Developer Community
Sponsored Link

PHP Buzz Forum
Finally: Services_Trackback 0.5.0

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Tobias Schlitt

Posts: 120
Nickname: dotxp
Registered: Sep, 2004

Tobias Schlitt is a geek, highly addicted to PHP.
Finally: Services_Trackback 0.5.0 Posted: May 24, 2005 5:48 AM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Tobias Schlitt.
Original Post: Finally: Services_Trackback 0.5.0
Feed Title: Tobias Schlitt - Weblog
Feed URL: http://php-applications.de/lists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundlists/listinfo/phpug-dortmundapplications/blog/rss.php?category=1_PEAR&version=0.91
Feed Description: a passion for php
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Tobias Schlitt
Latest Posts From Tobias Schlitt - Weblog

Advertisement

I finally managed to upload the next release of Services_Trackback (which is a generic class for sending and receiving trackbacks). The most important new feature for this version is integrated spam checking. Services_Trackback now implements a flexible API to add spam detection modules to a trackback using

$trackback->createSpamCheck();
$trackback->addSpamCheck();
$trackback->removeSpamCheck();
$trackback->checkSpam();

Spam checks in Services_Trackback are simple classes which implement the API of Services_Trackback_SpamCheck (abstract class). This allows you to simply define custom spam checkings and use them in combination with predefined ones. The following example creates 3 (predefined) spam checks and runs them in the order Wordlist, SURBL, DNSBL (priority). If one spam check determies spam, the process stops and $trackback->checkSpam() returns true, else false is returned:

// Add SURBL spamcheck with a priority of 1 (0 is the highest)
$trackback->createSpamCheck('SURBL', array(), 1);

// Add Wordlist spamcheck with option minmatches set to 2 and priority 0 (default)
$trackback->createSpamCheck('Wordlist', array('minmatches' => 2));

// Manually create a DNSBL spamcheck and add it with priority 3
$dnsbl = Services_Trackback_SpamCheck::create('DNSBL');
$trackback->addSpamCheck($dnsbl, 3);

// Finally check for spam
if (true === $trackback->checkSpam()) {
    // spam discovered
}

The following (built-in) spam checks are available so far:

  • Wordlist: Checks different elements of a trackback using a list of words (predefined "bad word" list from PEARWeb).
  • Regex: Checks different elements of a trackback against a list of PCREs.
  • DNSBL: Checks the host the trackback was sent from against 1 or more DNS blacklists.
  • SURBL: Extracts the links from different trackback elements and checks them against 1 or more SURBLs.

To install and try Services_Trackback simply do a

pear install Services_Trackback-0.5.0

The actual PEAR package is packaged with a package.xml and a package2.xml, which allows you to utilize the amazing new features of PEAR 1.4. If you installed the package using 1.4 you can install packages needed for autodiscovery features (automatically discover the trackback URI of a blog entry) by typing

pear install --alldeps Services_Trackback-0.5.0#autodiscover

If you want to use DNSBL/SURBL spam check modules, you will have to install the neccessary features with
pear install --alldeps Services_Trackback-0.5.0#dnsbl

I beg everyone out there for feedback regarding the package (especially the developers of well-known weblog applications like Serendipity), it's facilities and it's API. Please comment on this blog entry! My wish would be to have Services_Trackback adopted by those applications to generate a single point of development for the trackback feature (which would be a benefit for all user, of course).

For a complete list of features and a list of interessting links please refer to the extended version of this entry.


Continue reading "Finally: Services_Trackback 0.5.0"

Read: Finally: Services_Trackback 0.5.0

Topic: PHP at OSCON 2005 Previous Topic   Next Topic Topic: PHP Cache Control

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use