« December 2004 | Main | February 2005 »

January 29, 2005

recently_pinged_on Plugin

A plugin for adding 'recently_pinged_on' option to MTEntries container

recently-pinged-on.zip

0.10(2005.01.29): First Release
0.11(2005.01.29): Several fixes for better performance
0.12(2005.02.06): Performance tuning. And now MTEntryDate, MTEntriesHeader, MTEntriesFooter, MTEntryIfExtended, MTEntryIfAllowComments, MTEntryIfCommentsOpen, and MTEntryIfAllowPings can be used in MTEntries container.
0.15(2005.02.13): Now disables the plugin function if specified with lastn, days, or recently_commented_on options. And if using in category or date-based archives, the plugin lists up only pinged entries which are included in targeted archives.
0.16(2005.02.19): Fix an embarrassing bug.
0.18(2005.09.01): Fix for Movable Type 3.2.

The default MTEntries container tag does not have a function listing up recent incoming TB pings, as opposed to recent incoming comments. This plugin adds "recently_pinged_on" option to MTEntries and allows you to list up recent incoming pings as like comments.

EXAMPLE

<dl>
  <MTEntries recently_pinged_on="10">
    <dt><a href="<$MTEntryLink$>"><$MTEntryTitle$></a></dt>
    <MTPings lastn="5">
      <dd><a href="<$MTPingURL$>" rel="nofollow"><$MTPingBlogName$>: <$MTPingTitle$></a></dd>
    </MTPings>
  </MTEntries>
</dl>

SEE ALSO

Ogawa::Memoranda: recently_pinged_on Plugin (Totally in Japanese)

LICENSE

This code is released under the Artistic License. The terms of the Artistic License are described at http://www.perl.com/language/misc/Artistic.html.

AUTHOR & COPYRIGHT

Copyright 2005, Hirotaka Ogawa (hirotaka.ogawa at gmail.com)

Quasi-Spam Filter Plugin

A reference implementation of a Spam filter plugin

quasi-spamfilter.zip

0.10(2005.01.28): First Release
0.15(2005.02.01): Support TBPing spam filtering
0.17(2005.03.05): Support Perl 5.0
0.20(2005.04.08): Support Logging feature and refine the interfaces of spam-detection functions

This is a reference implementation of a Spam filter plugin and mainly targetted to spam filter developpers as well as actual users. This plugin allows you to easily customize your filtering policy and your reaction to comment & trackback spammers.

HOW TO CUSTOMIZE: Filtering Policy

The default policy of this plugin is to drop comments and trackback pings which have H1 and A elements. If you want to change your target, you can customize $COMMENT_PATTERN and $TBPING_PATTERN variable.

# Set your spam pattern
our $COMMENT_PATTERN = '<h1>|<a\s'; # H1 or A elements
our $TBPING_PATTERN = '<h1>|<a\s'; # H1 or A elements

You can change the is_comment_spam and is_tbping_spam subroutines if you want more clever mechanisms for filtering.

sub is_comment_spam {
    my $comment = shift;
    return ($comment->text =~ /$COMMENT_PATTERN/i);
}
 
sub is_tbping_spam {
    my $tbping = shift;
    return ($tbping->excerpt =~ /$TBPING_PATTERN/i);
}

HOW TO CUSTOMIZE: Reaction to Commment Spammers

The default reaction to comment spammers is "NOT TO TELL SPAMMERS WHETHER COMMENT SUBMISSIONS ARE SUCCEEDED OR NOT, BUT KILL THEM" reaction :) The Quasi-Spam Filter Plugin supports the following six reactions to comment spammers. And you can choose one of them by setting $COMMENT_METHOD variable.

CommentFilter
This method does not tell spammers whether comment submissions are succeeded or not.
CommentThrottleFilter
This method tells spammers that their comment submissions are failed by MT throttling mechanism.
CommentError (Default)
Just outputs a simple "Spam Comment!" message. This is the most light-weight solution.
CommentLongError
Outputs a kind error message by using "Comment Error Template".
CommentRedirect
Redirects to the URL specified by $URL variable. You can leed spammers to "Enlightment" site, or "Bizarre" site, or whatever else.
CommentEvilRedirect
Redirects to the URL specified by the URL field of spammers. If no URL is filled, redirects to the URL specified by $URL variable.

If you want to stop filtering spam comments, just set anything else (ex. '') to $COMMENT_METHOD variable.

HOW TO CUSTOMIZE: Reaction to Trackback Spammers

The default reaction to trackback spammers is "NOT TO TELL SPAMMERS WHETHER TRACKBACK PINGS ARE SUCCEEDED OR NOT, BUT KILL THEM" reaction :) The Quasi-Spam Filter Plugin supports the following three reactions to trackback spammers. And you can choose one of them by setting $TBPING_METHOD variable.

TBPingFilter
This method does not tell spammers whether trackback pings are succeeded or not.
TBPingThrottleFilter
This method tells spammers that their trackback pings are failed by MT throttling mechanism.
TBPingError (Default)
Just outputs a simple "TBPing Comment!" message. This is the most light-weight solution.

If you want to stop filtering spam TB pings, just set anything else (ex. '') to $TBPPING_METHOD variable.

SEE ALSO

Ogawa::Memoranda: Quasi-Spam Filter Plugin (Totally in Japanese)

LICENSE

This code is released under the Artistic License. The terms of the Artistic License are described at http://www.perl.com/language/misc/Artistic.html.

AUTHOR & COPYRIGHT

Copyright 2004, Hirotaka Ogawa (hirotaka.ogawa at gmail.com)

January 21, 2005

Show "nofollow" bookmarklet

Show "nofollow" (Drag this and drop your brower's menu bar)

This bookmarklet allows you to change "nofollow" links' color "lime". You can customize it whatever you like ;-)