<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>RTur.net</title>
    <description>.NET and Open Source: better together</description>
    <link>http://rtur.net/blog/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.6.0.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://rtur.net/blog/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>RTur.net</dc:creator>
    <dc:title>RTur.net</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/rtur" /><feedburner:info uri="rtur" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Custom Filters in BlogEngine 1.6</title>
      <description>&lt;a href="http://rtur.net/blog/image.axd?picture=custom_1.png" rel="lightbox"&gt;&lt;img style="display: inline" title="custom" alt="custom" src="http://rtur.net/blog/image.axd?picture=custom_thumb_1.png" width="93" height="107"&gt;&lt;/a&gt;  &lt;p&gt;&lt;span class="capital"&gt;S&lt;/span&gt;pam comments are annoying and sometimes looking at comment allowed by Akismet or some other anti-spam service you think – I’m sure I would do better. It is just so hard to get the plumbing in or I would made my very own solution. With &lt;a href='http://dotnetblogengine.net/' target='_blank'&gt;BlogEngine.Net&lt;/a&gt; 1.6 it is not, you can easily implement your own anti-spam filter or add existing if you like it more than built-in Akismet. Here is how.&lt;/p&gt; &lt;p&gt;First, open BE 1.6 solution in VS or &lt;a href="http://www.microsoft.com/express/Web/" target="_blank"&gt;VWD&lt;/a&gt; or whichever tool you are using to work with source code in .NET. Create new class in the App_Code folder, I called mine SpamBlocker. This class should implement ICustomFilter interface, it has just 4 members and looks like this:&lt;/p&gt; &lt;p&gt;&lt;pre class="brush: csharp"&gt;namespace BlogEngine.Core
{
    public interface ICustomFilter
    {
        bool Initialize();
        bool Check(Comment comment);
        void Report(Comment comment);
        bool FallThrough { get; }
    }
}
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Below is very simple implementation. It based on idea that most reliable way to identify spam is to check if comment contains link to site selling products or services and known for hiring spammers to push their ads all over the internet.&lt;/p&gt;
&lt;p&gt;&lt;pre class="brush: csharp"&gt;using System.Collections.Specialized;
using BlogEngine.Core;

public class SpamBlocker : ICustomFilter
{
    private static bool _passThrough = true;

    static StringCollection MockService()
    {
        StringCollection spammers = new StringCollection();

        spammers.Add("conference-call-providers.co.uk");
        spammers.Add("telebisyonserye.info");
        spammers.Add("qmw.com.au");

        return spammers;
    }

    public bool Initialize()
    {
        if(MockService().Count &amp;gt; 0) return true;
        return false;
    }

    public bool Check(Comment comment)
    {
        bool spam = false;

        foreach (string s in MockService())
        {
            if(comment.Content.Contains(s))
            {
                spam = true;
                break;
            }
        }

        _passThrough = (spam) ? false : true;
        return spam;
    }

    public void Report(Comment comment)
    {
        if(comment.IsApproved)
        {
            foreach (string s in MockService())
            {
                if(comment.Content.Contains(s))
                {
                    MockService().Remove(s);
                }
            }
        }
    }

    public bool FallThrough
    {
        get { return _passThrough; }
    }
}
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Mock service has few sites that spammers promote. Obviously, you would have to put some more work here for real deal, but for now it will do. All we need is a way to identify spam. For the sake of this example, if comment mentions any of these sites – it is spam.&lt;/p&gt;
&lt;p&gt;Now lets go over each method and explore what it does.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Initialize()&lt;/em&gt; – here you can verify that service is running, do authentication or any other kind of required verification. If return true, that means you are ready to handle comments. We just check if we have any spam sites in the list, if we do – good to go.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Check(Comment comment)&lt;/em&gt; – this is where you do your custom thing checking if comment is spam. &lt;a href='http://dotnetblogengine.net/' target='_blank'&gt;BlogEngine&lt;/a&gt; will pass comment to this method, so you can examine all it’s properties. For simplicity, we check if comment has reference to any of spam sites in the list. If it has, we return “true” meaning that comment is spam and set fall through to false (more on it later). &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Report(Comment comment)&lt;/em&gt; – this is a way to provide feedback to the service, so that you can make it smarter and identify spam better. If blogger restores comment marked by SpamBlocker as spam, we remove it from the list of spam sites. In the real world, here you can examine comment and try to figure out why you did a mistake marking it as spam or verifying that it is not spam and try to put more smarts in your service/filter.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;FallThrough&lt;/em&gt; – blog might run several custom filters, and we need a way for them to play well together. When fall through set to true, you saying “I think it is spam/not spam, but I’m ok with others to check on it and provide second opinion”. In this case, last judge wins – so the order in which you set filters to run (priority) is important.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://rtur.net/blog/image.axd?picture=filters.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="filters" border="0" alt="filters" src="http://rtur.net/blog/image.axd?picture=filters_thumb.png" width="303" height="53"&gt;&lt;/a&gt; &lt;a href="http://rtur.net/blog/image.axd?picture=spamfolder_1.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="spamfolder" border="0" alt="spamfolder" src="http://rtur.net/blog/image.axd?picture=spamfolder_thumb_1.png" width="328" height="59"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="clear: both"&gt;Here we pretty sure that when comment has spam site in it – it is spam. So we set fall through to false, telling &lt;a href='http://dotnetblogengine.net/' target='_blank'&gt;BlogEngine&lt;/a&gt; that, in this case, we want to be the ultimate judge and don’t pass comment to other custom services down the list.&lt;/p&gt;
&lt;p style="clear: both"&gt;If you go and make a comment with one of those sites in the comment body, it will be rejected by SpamBlocker. So here you have it – your very own custom anti-spam filter in 60 lines of code. Ok, it’ll be much more lines when you done with custom logic to identify spam, and you might even implement web service and make it available to other &lt;a href='http://dotnetblogengine.net/' target='_blank'&gt;BlogEngine&lt;/a&gt; users for this. But handle it on BlogEngien side is a snap.&lt;/p&gt;
&lt;p style="clear: both"&gt;One more thing, if you want blogger to be able turn your service on and off, you can easily do so by implementing it as extension, just the way Akismet is implemented in BlogEngine. Then, blogger can turn it off without removing it from the web site all together. I hope you’ll try it for yourself, and good luck fighting those nasty spam comments.&lt;/p&gt;</description>
      <link>http://feedproxy.google.com/~r/rtur/~3/m0IIwiKa5R8/post.aspx</link>
      <author>rtur.net</author>
      <comments>http://rtur.net/blog/post/2010/02/06/Custom-Filters-in-BlogEngine-16.aspx#comment</comments>
      <guid isPermaLink="false">http://rtur.net/blog/post.aspx?id=ec603d65-d379-47eb-a7e4-1b24c013a55c</guid>
      <pubDate>Sat, 06 Feb 2010 10:33:49 -0600</pubDate>
      <category>BlogEngine</category>
      <dc:publisher>rtur.net</dc:publisher>
      <pingback:server>http://rtur.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://rtur.net/blog/post.aspx?id=ec603d65-d379-47eb-a7e4-1b24c013a55c</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://rtur.net/blog/trackback.axd?id=ec603d65-d379-47eb-a7e4-1b24c013a55c</trackback:ping>
      <wfw:comment>http://rtur.net/blog/post/2010/02/06/Custom-Filters-in-BlogEngine-16.aspx#comment</wfw:comment>
      <wfw:commentRss>http://rtur.net/blog/syndication.axd?post=ec603d65-d379-47eb-a7e4-1b24c013a55c</wfw:commentRss>
    <feedburner:origLink>http://rtur.net/blog/post.aspx?id=ec603d65-d379-47eb-a7e4-1b24c013a55c</feedburner:origLink></item>
    <item>
      <title>BlogEngine.NET now at version 1.6</title>
      <description>&lt;p&gt;&lt;a href="http://rtur.net/blog/image.axd?picture=be16.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="be16" border="0" alt="be16" src="http://rtur.net/blog/image.axd?picture=be16_thumb.png" width="155" height="106"&gt;&lt;/a&gt; &lt;span class="capital"&gt;A&lt;/span&gt;fter few delays new version of &lt;a href='http://dotnetblogengine.net/' target='_blank'&gt;BlogEngine.Net&lt;/a&gt; has been released. Although this release is mostly incremental with minimum breaking changes, there are quite a few improvements, enhancements and bug fixes to make it worthwhile for those stuck on previous versions to upgrade. Upgrade instructions can be found &lt;a href="http://blogengine.codeplex.com/wikipage?title=Installation#version16upgrade" target="_blank"&gt;here&lt;/a&gt;, and you can download new version from the &lt;a href="http://blogengine.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=39387" target="_blank"&gt;project site&lt;/a&gt; on CodePlex.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Centralized Comment Management  &lt;li&gt;Automated Comment Spam Filtering with ability to plug-in custom Filtering modules  &lt;li&gt;Multiple Widget Zones (&lt;a href="http://allben.net/post/2009/04/18/Multiple-WidgetZones-in-BENET.aspx"&gt;details&lt;/a&gt;)  &lt;li&gt;Referrers data and Blogroll items now stored in Database when using the DB blog provider.  &lt;li&gt;Unsubscribe Link in Comment Notification Emails  &lt;li&gt;Referrer Data can be Stored for more than 7 days.  &lt;li&gt;Blogroll items can now be Ordered.  &lt;li&gt;Newsletter Widget more Intelligent - Emails sent when a post is going from an Unpublished to Published state.  &lt;li&gt;Twitter Widget - New options and improvements  &lt;li&gt;Page Slugs now saved in Database.  &lt;li&gt;New Logging system to Track events and errors.  &lt;li&gt;Unhandled Exception Handling  &lt;li&gt;Fixes to Comment Notification Emails not being sent out correctly in some cases.  &lt;li&gt;Outgoing Email improvements  &lt;li&gt;Many other improvements and fixes.&lt;/li&gt;&lt;/ul&gt;</description>
      <link>http://feedproxy.google.com/~r/rtur/~3/dEped7u0w24/post.aspx</link>
      <author>rtur.net</author>
      <comments>http://rtur.net/blog/post/2010/02/01/BlogEngineNET-now-at-version-16.aspx#comment</comments>
      <guid isPermaLink="false">http://rtur.net/blog/post.aspx?id=01d67236-fd48-47f5-a12e-e6ad48bff824</guid>
      <pubDate>Mon, 01 Feb 2010 21:28:01 -0600</pubDate>
      <category>BlogEngine</category>
      <dc:publisher>rtur.net</dc:publisher>
      <pingback:server>http://rtur.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://rtur.net/blog/post.aspx?id=01d67236-fd48-47f5-a12e-e6ad48bff824</pingback:target>
      <slash:comments>9</slash:comments>
      <trackback:ping>http://rtur.net/blog/trackback.axd?id=01d67236-fd48-47f5-a12e-e6ad48bff824</trackback:ping>
      <wfw:comment>http://rtur.net/blog/post/2010/02/01/BlogEngineNET-now-at-version-16.aspx#comment</wfw:comment>
      <wfw:commentRss>http://rtur.net/blog/syndication.axd?post=01d67236-fd48-47f5-a12e-e6ad48bff824</wfw:commentRss>
    <feedburner:origLink>http://rtur.net/blog/post.aspx?id=01d67236-fd48-47f5-a12e-e6ad48bff824</feedburner:origLink></item>
    <item>
      <title>Some Thoughts on Poll Results</title>
      <description>&lt;a href="http://rtur.net/blog/image.axd?picture=vote_1.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="vote" border="0" alt="vote" src="http://rtur.net/blog/image.axd?picture=vote_thumb_1.png" width="135" height="91"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://rtur.net/blog/image.axd?picture=results.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 10px; display: inline; float: right; border-top: 0px; border-right: 0px" title="results" border="0" alt="results" src="http://rtur.net/blog/image.axd?picture=results_thumb.png" width="128" height="190"&gt;&lt;/a&gt;&lt;span class="capital"&gt;O&lt;/span&gt;ne real surprise for me was that not many people use &lt;a href='http://dotnetblogengine.net/' target='_blank'&gt;BlogEngine&lt;/a&gt; as their sandbox and playground. To me as a developer from the beginning it was mostly a toy and only over time it grew up into something bigger with responsibilities attached, so I’m sort of impressed. It seems like what most folks really want is a stable mature product with great features and scalability built it. There is understandable desire for cool new tech on part of some but most seems really care about how it serve their blogging needs (ye, I know, shocking…). So in the end it looks to me like loud and clear call to power along with demand for more advanced and polished tools and features.&lt;/p&gt;</description>
      <link>http://feedproxy.google.com/~r/rtur/~3/ejLEFDlvWVg/post.aspx</link>
      <author>rtur.net</author>
      <comments>http://rtur.net/blog/post/2010/01/24/Some-Thoughts-on-Poll-Results.aspx#comment</comments>
      <guid isPermaLink="false">http://rtur.net/blog/post.aspx?id=3b2fe560-e519-441d-85c0-603f11b0dac9</guid>
      <pubDate>Sun, 24 Jan 2010 21:48:25 -0600</pubDate>
      <category>BlogEngine</category>
      <dc:publisher>rtur.net</dc:publisher>
      <pingback:server>http://rtur.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://rtur.net/blog/post.aspx?id=3b2fe560-e519-441d-85c0-603f11b0dac9</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://rtur.net/blog/trackback.axd?id=3b2fe560-e519-441d-85c0-603f11b0dac9</trackback:ping>
      <wfw:comment>http://rtur.net/blog/post/2010/01/24/Some-Thoughts-on-Poll-Results.aspx#comment</wfw:comment>
      <wfw:commentRss>http://rtur.net/blog/syndication.axd?post=3b2fe560-e519-441d-85c0-603f11b0dac9</wfw:commentRss>
    <feedburner:origLink>http://rtur.net/blog/post.aspx?id=3b2fe560-e519-441d-85c0-603f11b0dac9</feedburner:origLink></item>
  </channel>
</rss>
