Mark Brown

Nota Bene

Comment Spam and Blacklisting

Eric's ā€œKilling Comment Spamā€œ post and Luke Hutteman's comment sparked a little adventure for me. Of course, it's not complete or very functional. It's more of a motivation piece to get something started. I might have to jump into the .Text source to see about implementing some sort of plugin. I know .Text (Community Server :: Blogs) is provider based so it might be fairly easy to implement this into the Comment Provider... if there is such a beast. Here's a little bit of test code that grabs the MT-BlackList from the Comment Spam ClearingHouse.

namespace BlackList
{
    class Check
    {
        public static void Main(string[] args)
        {
            ArrayList expressions = new ArrayList();
            expressions = BuildBlackList();
            if ( expressions.Count > 0 )
            {
                foreach (string expression in expressions)
                {
                    try
                    {
                        Regex pattern = new Regex(expression,
                         RegexOptions.Multiline|RegexOptions.IgnoreCase);
                        if (pattern.IsMatch("01-logo.com"))
                            Console.WriteLine("Found A Match");
                        pattern = null;
                    }
                    catch {}
                }
            }
            Console.ReadLine();
        }
        private static ArrayList BuildBlackList()
        {
            // In reality this file would be local and downloaded once a
            // day. Or, if we were in a web environment we could cache it.
            // But, hey, its just a demo to spark some thought.
            //
            string url = "http://www.jayallen.org/comment_spam/blacklist.txt";
       
            ArrayList expressions = new ArrayList();
            WebResponse response = null;
            try
            {
                WebRequest request = WebRequest.Create(url);
                if (request != null)
                {
                    response = request.GetResponse();
                    using (StreamReader sr =
                     new StreamReader(response.GetResponseStream()))
                    {
                        String line;
                        while ((line = sr.ReadLine()) != null)
                        {
                            if (line.Substring(0,1) != "#" )
                                expressions.Add(line);
                        }
                    }
                }
            }
            catch(Exception)
            {
                throw;
            }
            return expressions;
        }
    }
}

Comments

Scott Galloway said:

Very nice...I certainly plan to stick this into my .TEXT implementation this weekend...
# July 27, 2004 5:14 PM

Luke Hutteman said:

I've never really looked at Jay's MT-BlackList code (perl scares me:-) but I wonder if it would be faster to build and prepare one huge Regex from all the individual lines instead of going through them one at a time.

IMO, true integration of this in .Text should at least:
* keep track of it's own blacklist which users can add new regex's to that may not be in the master blacklist yet. Adding of new regex's should be done through a textarea instead of one-line-input so new ones can be mass-imported (by copy-n-pasting the master blacklist for instance)
* block comments and trackbacks on-the-fly if they match a Regex in the blacklist, giving the user some level of feedback in case of false positives (contact me at user[at]domain[dot].com if you think this is in error yada yada yada)
* give the user the option of checking the last x comments/trackbacks against the blacklist (very useful if you just got spambombed and all of a sudden have hundreds of new comments to get rid of; just add the spam-url and mass-delete all matching comments)

any particular reason for the "catch (Exception) { throw; }" btw? :-)
# July 29, 2004 4:31 PM

Mark Brown said:

Luke, Those are great suggestions for true integration. I wonder if it makes sense to build a tool that would integrate other blacklists and filters. Spam Assassin comes to mind and I'm sure there are others. The Bayesian filters won't be of much use but the content filters might fit into a solution nicely. Maybe some sort of Spam Assassin proxy.

Did you ever look at something and wonder 'What was I thinking...?" and not know the answer.
# July 29, 2004 11:46 PM

TrackBack said:

^_^,Pretty Good!
# April 10, 2005 8:29 AM

Resume said:

I think it'd be better if IP can be taken into consideration.

Also this function would also cost some computer capacity

# September 12, 2007 2:06 AM

Bob24 said:

What is your Country of Nationality? ,

# October 22, 2009 7:39 PM

Bella Smith said:

It is rather interesting for me to read that article. Thanks the author for it. I like such topics and everything that is connected to this matter. I definitely want to read more soon.

Bella Smith    

<a href="milanescorts.com/">escort agency milan</a>

# March 22, 2011 2:25 PM

Bella Swenson said:

Rather cool site you've got here. Thanx for it. I like such themes and anything that is connected to this matter. I would like to read a bit more soon.  

Bella Swenson    

<a href="www.pickescort.com/">escort cim london</a>

# April 15, 2011 3:35 PM

bustuva said:

some greate lines are here

# November 18, 2011 9:36 AM

camaropl said:

<a href=http://2yd.net/1jk>coffee shop millionaire reviews</a>

# January 9, 2012 10:04 PM

camarooo said:

<a href=http://2yd.net/1ji>fat burning furnace review</a>

# January 11, 2012 8:47 AM

Lively said:

Then, write all the scrambled words on a paper and give a copy to each guest (or divide everyone into pairs).

Phuket is undoubtedly the best gift by the Mother Nature to the mankind.

For many reasons this group are the ones that

eat of out boxes and bags.

# January 31, 2013 10:11 PM

Fogarty said:

I am truly glad to read this website posts which includes lots of useful data,

thanks for providing these information.

# February 21, 2013 9:26 AM

Johnson said:

Stunning quest there. What happened after? Thanks!

# February 23, 2013 11:12 PM

Mcgee said:

Write more, thats all I have to say. Literally, it seems

as though you relied on the video to make your point.

You obviously know what youre talking about, why throw away your intelligence on just posting videos

to your weblog when you could be giving us something informative to

read?

# February 26, 2013 1:11 PM

Cooke said:

Very rapidly this website will be famous amid all blogging users, due to it's fastidious articles

# March 1, 2013 10:53 AM

Loera said:

Thanks in support of sharing such a pleasant thinking, paragraph

is good, thats why i have read it fully

# March 2, 2013 11:18 AM

Hampton said:

This piece of writing is really a fastidious

one it helps new net users, who are wishing in favor of

blogging.

# March 2, 2013 6:07 PM

Sumner said:

I’m not that much of a internet reader to be honest but your blogs really nice, keep

it up! I'll go ahead and bookmark your site to come back in the future. Many thanks

# March 4, 2013 4:33 PM

Pulley said:

This design is wicked! You certainly know how to keep a reader entertained.

Between your wit and your videos, I was almost moved to start my own blog (well, almost.

..HaHa!) Great job. I really enjoyed what you had to say, and more than that, how you presented it.

Too cool!

# March 9, 2013 3:42 AM

Crosby said:

When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get three emails with the same comment.

Is there any way you can remove people from that service? Appreciate it!

# March 14, 2013 1:15 PM

Collier said:

Wow, fantastic weblog format! How long have you ever been running a blog for?

you made blogging glance easy. The entire look of your site

is magnificent, as well as the content material!

# March 17, 2013 11:51 AM

Oliveira said:

Hello colleagues, how is the whole thing, and what you want to say on the topic of this post, in my view its genuinely amazing designed for me.

# March 17, 2013 1:49 PM

Mosley said:

This blog was... how do I say it? Relevant!

! Finally I've found something which helped me. Many thanks!

# March 17, 2013 6:55 PM

Zavala said:

You are so awesome! I do not believe I've read through something like that before. So good to find somebody with a few unique thoughts on this subject matter. Really.. many thanks for starting this up. This web site is something that is required on the internet, someone with a little originality!

# March 26, 2013 5:46 AM

Lattimore said:

Thanks for a marvelous posting! I definitely enjoyed reading it, you happen to be

a great author.I will be sure to bookmark your

blog and will come back down the road. I want to encourage you to ultimately continue your great posts, have a nice evening!

# April 8, 2013 10:19 AM

Tovar said:

I go to see every day a few blogs and information sites to read articles or reviews, except this web site provides quality based writing.

# April 9, 2013 12:44 AM

Breeden said:

I relish, cause I discovered exactly what I

was having a look for. You have ended my 4 day lengthy hunt!

God Bless you man. Have a nice day. Bye

# April 9, 2013 12:50 AM

Willingham said:

Hello, I think your blog might be having

browser compatibility issues. When I look at your blog site in Safari,

it looks fine but when opening in Internet Explorer,

it has some overlapping. I just wanted to give you a quick heads up!

Other then that, great blog!

# April 9, 2013 5:15 AM

Marble said:

Good post. I am facing a few of these issues as well.

.

# April 11, 2013 8:55 AM

Bourgeois said:

Hi, Neat post. There's an issue together with your site in web explorer, may check this? IE still is the market leader and a big part of folks will miss your great writing due to this problem. The movement from horror based games started with Resident Evil 4 which still managed to entertain us and cause a hugely positive effect around gamers, it wasn't until RE5

that really changed the way the game was played

due to the forced cooperation of the game. With its blend of aerial and ground combat, Uprising is a perfect game for the new 3DS.

Players will be able post a dying message from the Game Over screen that others

players around the world will see.

# April 13, 2013 5:55 AM

Reed said:

Does your website have a contact page? I'm having a tough time locating it but, I'd

like to send you an e-mail. I've got some recommendations for your blog you might be interested in hearing. Either way, great website and I look forward to seeing it improve over time.

# April 13, 2013 3:00 PM

Blackman said:

Hey superb website! Does running a blog like this require a massive amount work?

I've no expertise in programming however I was hoping to start my own blog soon. Anyhow, should you have any recommendations or techniques for new blog owners please share. I know this is off topic however I simply needed to ask. Cheers!

# April 13, 2013 4:48 PM

Zielinski said:

You're so interesting! I do not think I've read through something like that

before. So good to discover somebody with some original thoughts on this issue.

Seriously.. thanks for starting this up. This site is something that

is needed on the web, someone with a bit of originality!

# April 19, 2013 6:55 PM

mcuztkry@gmail.com said:

parabens pelo blog, belissimo trabalho

# April 20, 2013 7:17 AM

Fried said:

My spouse and I stumbled over here from a different

web address and thought I may as well check things out.

I like what I see so now i am following you. Look forward to exploring your web page

repeatedly.

# April 20, 2013 11:49 AM

Delgado said:

These are truly enormous ideas in regarding blogging.

You have touched some pleasant points here. Any way keep up wrinting.

# May 10, 2013 3:06 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)